c++ - Add network to Qt Project -
i try use qtnetwork library , added dependencies in .pro file. when compile code qt creator fails in building project , claims
c1083: include "qtcpsocket": no such file or directory - telnet.h:4
i thought adding network .pro file enough?
networkmonitor.pro
#------------------------------------------------- # # project created qtcreator 2017-07-24t13:18:19 # #------------------------------------------------- qt += core gui network charts # greaterthan(qt_major_version, 4): qt += widgets target = networkmonitor template = app # following define makes compiler emit warnings if use # feature of qt been marked deprecated (the exact warnings # depend on compiler). please consult documentation of # deprecated api in order know how port code away it. defines += qt_deprecated_warnings # can make code fail compile if use deprecated apis. # in order so, uncomment following line. # can select disable deprecated apis version of qt. #defines += qt_disable_deprecated_before=0x060000 # disables apis deprecated before qt 6.0.0 sources += \ main.cpp \ mainwindow.cpp \ telnet.cpp headers += \ mainwindow.h \ telnet.h forms += \ mainwindow.ui
telnet.h
#ifndef telnet_h #define telnet_h #include <qtcpsocket> #include <qtcpserver> #include <qdebug> class telnet { public: telnet(); void sendvalues(qstring _ip, int _port, qstring _message); private: qtcpsocket *socket; }; #endif // telnet_h
normally means forgot re-run qmake
Comments
Post a Comment