How to compile FastCGI++ Code?

735 Views Asked by At

What command should I use to compile FastCGI++ Code?

The documented command gives me several errors.

user@user:~/code$ g++ -o main.fcgi main.cpp pkg-config –libs –cflags fastcgi++
g++: error: pkg-config: No such file or directory
g++: error: –libs: No such file or directory
g++: error: –cflags: No such file or directory
g++: error: fastcgi++: No such file or directory
2

There are 2 best solutions below

0
On

You need backticks for you pkg-config command

g++ -o main.fcgi main.cpp `pkg-config --libs --cflags fastcgi++`

In my system, this command is interpreted as

g++ -o main.fcgi main.cpp -I/usr/local/include -pthread -L/usr/local/lib -lfastcgipp -lboost_thread-mt -lboost_system-mt -lboost_date_time-mt
0
On

Sometimes FastCGI++ is compiled with it's Boost libraries dynamically. This means, afaik, that you need to link to them as well when you compile your code.

g++ -o main.fcgi main.cpp -lfastcgipp -lboost_system -lboost_thread