Support #3579
closedBuild a statically linked FastCGI Wt application
0%
Description
Hi all,
I am trying to get a Wt application to run with Apache, through FastCGI. The application uses static resources attached to the Wt::WServer class.
The catch is I want to do this with a statically linked Wt, i.e., without having to do a "make install" beforehand.
I have managed to build Wt with static linking of all the libraries by avoiding to build the tests. I used the following command switches:
-DBoost_USE_STATIC_LIBS=ON
-DSHARED_LIBS=OFF
-DBUILD_TESTS=OFF
The static libraries libwthttp.a, libwtfcgi.a, libwt.a are now produced after make. The problem is:
-When I put all of these in my library path, the application builds fine, but works only as a standalone HTTP server, not as a FastCGI application.
-When I include only libwt.a and libwtfcgi.a in my library path and try to build, I get compilation errors such as (specific errors depend on the order of static library inclusion):
FCGIStream.C:--1: error: undefined reference to `FCGX_Finish_r' (File not found: FCGIStream.C)
WServer.C:--1: error: undefined reference to `Wt::WebMain::shutdown()' (File not found: WServer.C)
Is there some standard procedure to build a statically linked a FastCGI Wt application? Any help on this will be greatly appreciated!
Thanks,
Periklis
Updated by Wim Dumon over 9 years ago
- Status changed from New to Resolved
Hi,
Since static libraries are not linked to its dependencies, you need to link them explicitly yourself in your application. So you will need to add the fcgi library, all boost libraries that Wt uses and other dependencies to your link command.
For fcgi deployments, you must not add libwthttp.a to your link path.
Wim.
Updated by Koen Deforche over 9 years ago
- Status changed from Resolved to Closed