首页| 论坛| 消息

标题:Qt4.1.2 中的关于网络通信的例子
作者:weilong122
日期:2006-04-21 21:56
内容:

老大,Qt4.1.2中关于网络应用中的那些例子,我是直接将它的代码拿过来用的
我在编译后总是产生这样的错误,不知道什么原因,期待你的帮忙
先谢谢了

client.cpp:25:21: QtNetwork: No such file or directory
In file included from client.cpp:27:
client.h:28:22: QTcpSocket: No such file or directory
In file included from client.cpp:27:
client.h:45: error: `QAbstractSocket' has not been declared
client.h:45: error: variable or field `displayError' declared void
client.h:45: error: expected `;' before '(' token
client.cpp: In constructor `Client::Client(QWidget*)':
client.cpp:51: error: invalid use of undefined type `struct QTcpSocket'
client.h:33: error: forward declaration of `struct QTcpSocket'
。。。。。。。。。。。。。。。。。。。。。。。。。


#1 [weilong122 04-22 11:42]
有没有编译过那些例子的?
你们可以成功吗?
#2 [XChinux 04-22 11:44]
不能直接拿来用的,你得搞清楚他源码里各文件之间的关系,着情使用。还有工程里的设置。
#3 [weilong122 04-22 12:13]
我看了下代码应该是没问题的,我代码还是看的懂的,虽然现在自己写还是有点困难
那么工程里要怎么 设计?
#4 [wengj 09-01 21:25]
qmake 完后,
在 qtwhat.pro 文件里加入QT +=network

回复 发表
主题 版块