QT新手请教:
环境:Ubuntu 8.10
QT版本:qt-x11-opensource-src-4.5.0
问题:
程序使用的是example中的network-chat,设置好QTDIR、PATH、LD_LIBRARY_PATH后,qmake,make。
编译报错:
client.h:45:27: error: QAbstractSocket: 没有该文件或目录
client.h:47:24: error: QHostAddress: 没有该文件或目录
In file included from client.h:49,
from chatdialog.h:46,
from chatdialog.cpp:44:
server.h:45:22: error: QTcpServer: 没有该文件或目录
检查Makefile,发现INCPATH中没有加入QtNetwork目录。
添加该目录后,再make,还是有错,
错误为:
client.cpp:(.text+0x96): undefined reference to `QHostAddress::operator==(QHostAddress const&) const'
client.cpp:(.text+0xe6): undefined reference to `QAbstractSocket::peerPort() const'
client.o: In function `Client::Client()':
client.cpp:(.text+0x347): undefined reference to `QTcpServer::serverPort() const'
client.cpp:(.text+0x409): undefined reference to `QTcpServer::~QTcpServer()'
client.o: In function `Client::Client()':
client.cpp:(.text+0x487): undefined reference to `QTcpServer::serverPort() const'
client.cpp:(.text+0x549): undefined reference to `QTcpServer::~QTcpServer()'
这一次就不知道怎么办了,还请大家帮助。
PS:
该程序如果使用qt-embedded-4.5.0进行编译,毫无问题。