Wt (we pronounce that as 'witty') is a C++ library for developing interactive web applications [1].
- 'Hello Wt' program
- Wt articles
- Wt and assert
- Wt classes
- Wt deployment
- Wt examples
- Wt FAQ
- Wt with other libraries
Note for Qt Creator users
Add the following line to your Qt project file (to prevent link errors like undefined reference to 'Wt::WRun(int, char**, Wt::WApplication* (*)(Wt::WEnvironment const&))'):
For a Wt application to run, choose one of these options:
-
Use my WtAutoConfig class:
-
Add the following line to your Qt project file:
-
Change your main to the following, to let WtAutoConfig add the arguments:
I follow this approach in my larger programs.
-
-
Change your main to the following, to call WRun with the arguments added with a C++11 initializer list:
int main(int, char *argv[]) { //C++11 initializer list const char * const v[7] = { argv[0], "--docroot", ".", "--http-port", "8080", "--http-address", "0.0.0.0" }; return WRun(7, const_cast<char**>(v), &CreateApplication); }
I follow this approach my very small, mostly demonstrational, programs, for example in memcheck example 6.
-
Add the following arguments to the Run Settings (to prevent the misc error stat: No such file or directory. Document root ("") not valid.
Or to redirect the output to a log file (untested):
I never follow this approach, because I prefer my solutions in code.