• 8885阅读
  • 4回复

Qt4.1.2 中的关于网络通信的例子 [复制链接]

上一主题 下一主题
离线weilong122
 

只看楼主 倒序阅读 楼主  发表于: 2006-04-21
老大,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'
。。。。。。。。。。。。。。。。。。。。。。。。。
[ 此贴被weilong122在2006-04-23 15:12重新编辑 ]
离线weilong122

只看该作者 1楼 发表于: 2006-04-22
有没有编译过那些例子的?
你们可以成功吗?
离线XChinux

只看该作者 2楼 发表于: 2006-04-22
不能直接拿来用的,你得搞清楚他源码里各文件之间的关系,着情使用。还有工程里的设置。
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线weilong122

只看该作者 3楼 发表于: 2006-04-22
我看了下代码应该是没问题的,我代码还是看的懂的,虽然现在自己写还是有点困难
那么工程里要怎么 设计?
[ 此贴被weilong122在2006-04-22 16:50重新编辑 ]
离线wengj
只看该作者 4楼 发表于: 2006-09-01
qmake 完后,
在 qtwhat.pro 文件里加入QT +=network
快速回复
限100 字节
 
上一个 下一个