Skip to content

Latest commit

 

History

History
176 lines (102 loc) · 6.11 KB

File metadata and controls

176 lines (102 loc) · 6.11 KB

 

 

 

 

 

 

Link error

 

 

 

 

 

 

Full error message

 


/MyFolder/main.o:: In function 'main': /MyFolder/main.cpp:16: error: undefined reference to 'Wt::WRun(int, char**, Wt::WApplication* (*)(Wt::WEnvironment const&))'

 

 

 

 

 

Technical facts

 

Application type(s)

Operating system(s) or programming environment(s)

IDE(s):

Project type:

Compiler(s):

Libraries used:

  • Wt 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

 

 

 

 

 

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); } //---------------------------------------------------------------------------

 

 

 

 

 

Solution

 

Add the following line to your Qt project file:

 


LIBS += -lwt -lwthttp

 

 

Note that the fixed version results in the misc error stat: No such file or directory. Document root ("") not valid.