• 6570阅读
  • 4回复

求助:Release版的incomingConnection没有响应 [复制链接]

上一主题 下一主题
离线ghnie
 

只看楼主 倒序阅读 楼主  发表于: 2009-02-02
— 本帖被 XChinux 执行加亮操作(2009-02-05) —
source post_thread.rar (5 K) 下载次数:2   用VS2005+Qt4.3.1开发
debug版时,当点击start按钮后,如果有一个tcp连接,
如telnet 127.0.0.1 4000
后,
MainServer.cpp的
void MainServer::incomingConnection(int socketDescriptor)
会被自动执行,打印输出
<<<<<<<MainServer::incomingConnection>>>>>

但release版时incomingConnection函数确没有响应

不知道是为什么

有做过网络方面的哪位大侠帮忙看看

谢谢。
只看该作者 1楼 发表于: 2009-02-03
你输出到哪里的?qDebug么……

看了下源代码,还真是……
叫qDebug,当然只在debug模式下输出咯……

void qDebug ( const char * msg, ... )
Calls the message handler with the debug message msg. If no message handler has been installed, the message is printed to stderr. Under Windows, the message is sent to the console, if it is a console application; otherwise, it is sent to the debugger. This function does nothing if QT_NO_DEBUG_OUTPUT was defined during compilation.
离线ghnie

只看该作者 2楼 发表于: 2009-02-03
我也试过用QMessageBox,也不行
另外:qDebug在release模式下也能输出。
只看该作者 3楼 发表于: 2009-02-03
QMessageBox不行可能是因为没指定父窗口?

再不行,printf啊
离线ghnie

只看该作者 4楼 发表于: 2009-02-03
引用第3楼都市无名者于2009-02-03 12:22发表的  :
QMessageBox不行可能是因为没指定父窗口?

QMessageBox在debug模式下是可以的,所有肯定指定了父窗口。

估计是qt库的版本问题,是不是debug版的和release版的库不同?
快速回复
限100 字节
 
上一个 下一个