(C++) 

undefined reference to 'Wt::WRun(int, char**, Wt::WApplication* (*)(Wt::WEnvironment const&))'
- Download the Qt Creator project 'CppLinkErrorUndefinedReferenceToWtWrun' with this error
- Download the Qt Creator project 'CppLinkErrorUndefinedReferenceToWtWrun' with this error fixed
/MyFolder/main.o:: In function 'main': /MyFolder/main.cpp:16: error: undefined reference to 'Wt::WRun(int, char**, Wt::WApplication* (*)(Wt::WEnvironment const&))'
Operating system(s) or programming environment(s)
Ubuntu 10.10 (maverick)
Qt Creator 2.0.0
- G++ 4.4.5
Libraries used:
Wt: version 3.1.2
Qt project file: CppLinkErrorUndefinedReferenceToWtWrun.pro
#------------------------------------------------- # # Project created by QtCreator 2010-12-29T17:23:02 # #------------------------------------------------- QT += core QT -= gui TARGET = CppLinkErrorUndefinedReferenceToWtWrun CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp
//--------------------------------------------------------------------------- #include <Wt/WApplication> //--------------------------------------------------------------------------- struct MyWtClass : public Wt::WApplication { MyWtClass(const Wt::WEnvironment& env) : Wt::WApplication(env) {} }; //--------------------------------------------------------------------------- Wt::WApplication * createApplication(const Wt::WEnvironment& env) { return new MyWtClass(env); } //--------------------------------------------------------------------------- int main(int argc, char **argv) { return Wt::WRun(argc, argv, &createApplication); } //---------------------------------------------------------------------------
Add the following line to your Qt project file:
- Download the Qt Creator project 'CppLinkErrorUndefinedReferenceToWtWrun' with this error
- Download the Qt Creator project 'CppLinkErrorUndefinedReferenceToWtWrun' with this error fixed
Note that the fixed version results in the misc error stat: No such file or directory. Document root ("") not valid.

