QT Hello 程序qmake通过,make报错 libts-0.0.so.0 libpng.so.3

软件和网站开发以及相关技术探讨
回复
sanshaoye
帖子: 1
注册时间: 2010-11-16 13:58

QT Hello 程序qmake通过,make报错 libts-0.0.so.0 libpng.so.3

#1

帖子 sanshaoye » 2010-11-16 16:07

源码:

#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();

}

make信息:
:: warning: libts-0.0.so.0, needed by /usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
:: warning: libpng.so.3, needed by /usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
/usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.so:: error: undefined reference to `png_get_valid'
/usr/local/Trolltech/QtEmbedded-4.6.3-arm/lib/libQtGui.so:: error: undefined reference to `png_set_error_fn'
。。。。。。。。。。。。。。。

我查了usr/local/lib 和 usr/lib 下面有对应的库。我添加了路径到qt的 LD_LIBRARY_PATH,但还是同样的错误。
gclinux
帖子: 37
注册时间: 2010-04-10 0:55

Re: QT Hello 程序qmake通过,make报错 libts-0.0.so.0 libpng.so.3

#2

帖子 gclinux » 2010-11-29 22:47

你生成的工程文件可能有问题。
我是成功生成了

gclinux@gclinux-pc:~/workspace/qt4hello$ qmake -project
gclinux@gclinux-pc:~/workspace/qt4hello$ qmake
gclinux@gclinux-pc:~/workspace/qt4hello$ make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o main.o main.cpp
g++ -Wl,-O1 -o qt4hello main.o -L/usr/lib -lQtGui -lQtCore -lpthread
gclinux@gclinux-pc:~/workspace/qt4hello$

你把源程序叫main.cpp看看

我工程文件如下:
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .

# Input
SOURCES += main.cpp
仅供参考
gclinux
帖子: 37
注册时间: 2010-04-10 0:55

Re: QT Hello 程序qmake通过,make报错 libts-0.0.so.0 libpng.so.3

#3

帖子 gclinux » 2010-11-29 22:49

再加个效果图
再加个效果图
截取选区_001.png (3.37 KiB) 查看 1892 次
补充个图,作为佐证
回复