Search code examples
c++raspberry-pig++gnu

Getting compile errors when compiling gnu cgi for web project


On my raspberry pi I am using c++ to write a web project. I am following C++ CGI. I installed gnu's cgi library using apt-get installed libcgicc3. When I compile the form g++ -o cform.cgi cform.cpp i am getting the following error. Fatal error cgicc/CgiDefs.h no such file. How do I find the cgi library. I have seen an example of the compile g++ -o file.cgi file.cpp /usr/libcgicc.a that doesn't work for me. libcgicc.a is not in that directory. Where can I find the file to compile the application.


Solution

  • You're almost there. You need to install the libcgicc-dev package instead, that containers header files and the library to link to.

    To link with the library (called libcgicc.so):

    g++ -o file.cgi file.cpp -lcgicc