[SOLVED]Errors while compiling
-
Hi All,
I am getting many error when compiling and cannot understand what the cause:
udpchat.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QLineEdit::QLineEdit(class QWidget *)" (_imp??0QLineEdit@@QEAA@PEAVQWidget@@@Z) referenced in function "public: __cdecl UDPChat::UDPChat(class QWidget *)" (??0UDPChat@@QEAA@PEAVQWidget@@@Z)
udpchat.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QTextEdit::QTextEdit(class QWidget *)" (_imp??0QTextEdit@@QEAA@PEAVQWidget@@@Z) referenced in function "public: __cdecl UDPChat::UDPChat(class QWidget *)" (??0UDPChat@@QEAA@PEAVQWidget@@@Z)
There are about 40 errors like this.
Under each of them it states " File not found: udpchat.obj"
I have made a class udpchat class ( a sub-class of QWidget).
Please advice.
I have run QMake many times.
-
Hi,
Can you show your project pro file ?
-
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .Input
SOURCES += main.cpp udpchat.cpp
QT += network
HEADERS += udpchat.h
-
Are you using Qt 4 or Qt 5 ?
Also, you should give TARGET a value
-
Hi,
I am using Qt 5.
What value should I give TARGET?
Thanks
-
Hi,
Target is the name of your final executable . You should try this "tutorial":http://qt-project.org/doc/qt-4.8/qmake-tutorial.html -
Qt5: You need to add "widgets" to the QT variable value (and rerun qmake) to have access to the QLineEdit, QtextEdit and other widgets
-
@ChrisW67: Yep. It now runs.
Thank you very much.