Toad
Toad

Reputation: 29

Trouble compiling c++ cgi file for web server using cygwin and libcgicc

I'm trying to compile a c++ program using cygwin g++ with libcgicc for a project. I've copied all the files over from the cgicc folder in the "https://ftp.gnu.org/gnu/cgicc/cgicc-3.2.20.tar.gz" archive.

When i compile with this command "g++ test3.cpp -o test3.cgi" using Cygwin I get this error:

test3.cpp:7:10: fatal error: cgicc/CgiDefs.h: No such file or directory
    7 | #include <cgicc/CgiDefs.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.

This is because CgiDefs.h is called "CgiDefs.h.in" for some reason, why is it not a .h file by default?

If i rename the CgiDefs.h.in file to CgiDefs.h and recompile then i get this error:

/usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccPwnaVS.o:test3.cpp:(.text+0x23): undefined reference to `cgicc::Cgicc::Cgicc(cgicc::CgiInput*)'
/usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccPwnaVS.o:test3.cpp:(.text+0xfb): undefined reference to `cgicc::Cgicc::getElement(std::string const&)'
/usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccPwnaVS.o:test3.cpp:(.text+0x26f): undefined reference to `cgicc::Cgicc::getElement(std::string const&)'
/usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccPwnaVS.o:test3.cpp:(.text+0x3e4): undefined reference to `cgicc::Cgicc::~Cgicc()'
/usr/lib/gcc/x86_64-pc-cygwin/12/../../../../x86_64-pc-cygwin/bin/ld: /tmp/ccPwnaVS.o:test3.cpp:(.text+0x472): undefined reference to `cgicc::Cgicc::~Cgicc()'
collect2: error: ld returned 1 exit status

What can I do to resolve this?

Upvotes: -1

Views: 51

Answers (0)

Related Questions