qt程序运行时的错误error:undefined reference to `_imp___ZN10QTcpSocketD1Ev'

出现的错误:
  undefined reference to `_imp___ZN10QTcpSocketD1Ev'
  undefined reference to `_imp___ZN10QTcpSocketC1EP7QObject'
  undefined reference to `_imp___ZN10QTcpSocketD1Ev'
  undefined reference to `_imp___ZN10QTcpSocketD1Ev'
  undefined reference to `_imp___ZN10QTcpSocketD1Ev'
  undefined reference to `_imp___ZN10QTcpSocketD1Ev'
  undefined reference to `_imp___ZN10QTcpSocketD1Ev'
  undefined reference to `_imp___ZN15QAbstractSocket13connectToHostERK7QStringt6QFlagsIN9QIODevice12OpenModeFlagEE'
  undefined reference to `_imp___ZN15QAbstractSocket5closeEv'

  collect2: ld returned 1 exit status

解决方法:
链接错误,检查.pro文件中是否缺少
   QT += network
 
posted @ 2018-04-24 21:20  爱学习的小懒虫  阅读(3626)  评论(0编辑  收藏  举报