刚开始学QT,在编写TCP、UART的时候,两次遇到了这样的编译错误,以TCP为例:
网上有很多人遇到过这样的编译错误,如这位朋友的文章:http://icivelee.blog.163.com/blog/static/147198932201171025810737/invalid use of incomplete type 'struct QHostAddress'
forward declaration of 'struct QHostAddress'
有人说这是版本的原因,但我没有深究。我的错误最终解决办法是加上这样一句话:
网上有个朋友说: Such an error message in Qt usually means that you have to#include <QHostAddress>
#include <Q...>
,实乃高见。