Hi,
I am having trouble compiling my c code for GGI.
I got an API of sorts, from www.boutell.com. I got it working without too much dificulty in MS C++ 5
but can't get it working for some reason in dev-c++.
The code comes with a .c and .h file. In the .c file the main() function does all the necessary parsing to get cgi variables and it calls a cgiMain() function which is where the user (me) writes all the required code treating it like a the main function of my code.
Hope the poor explaniation of what i am trying to do helps.
the compile log is below.
Version: Dev-C++ 4.9.9.0
Compile LOG:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\projects\myCGI\Makefile.win"
Executing make clean
rm -f myCGI.o CGIC.o myCGI.exe
myCGI.o(.text+0xa6):myCGI.c: undefined reference to `cgiHeaderContentType'
myCGI.o(.text+0x135):myCGI.c: undefined reference to `cgiFormStringNoNewlines'
myCGI.o(.text+0x19b):myCGI.c: undefined reference to `cgiFormString'
myCGI.o(.text+0x1fb):myCGI.c: undefined reference to `cgiFormCheckboxSingle'
myCGI.o(.text+0x2a3):myCGI.c: undefined reference to `cgiFormDoubleBounded'
myCGI.o(.text+0x304):myCGI.c: undefined reference to `cgiFormInteger'
myCGI.o(.text+0x377):myCGI.c: undefined reference to `cgiFormSelectSingle'
myCGI.o(.text+0x445):myCGI.c: undefined reference to `cgiFormSelectMultiple'
myCGI.o(.text+0x58f):myCGI.c: undefined reference to `cgiFormRadio'
myCGI.o(.text+0x5cd):myCGI.c: undefined reference to `cgiFormString'
myCGI.o(.text+0x69e):myCGI.c: undefined reference to `cgiFormCheckboxMultiple'
myCGI.o(.text+0x76b):myCGI.c: undefined reference to `cgiFormStringMultiple'
myCGI.o(.text+0x824):myCGI.c: undefined reference to `cgiStringArrayFree'
CGIC.o(.text+0x3c3):CGIC.C: undefined reference to `cgiMain()'
make.exe: *** [myCGI.exe] Error 1
Execution terminated
Execution terminated
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Looks to me as though you need to build the cgic library/archive, link it in your Projects and *also* add cgic.c with your source in those Projects. Seems a little odd, but but it apparently has something to do with the cgiMain stuff. Read the documentation carefully, and see Adrian's FAQ, as well....
-- Jim.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am having trouble compiling my c code for GGI.
I got an API of sorts, from www.boutell.com. I got it working without too much dificulty in MS C++ 5
but can't get it working for some reason in dev-c++.
The code comes with a .c and .h file. In the .c file the main() function does all the necessary parsing to get cgi variables and it calls a cgiMain() function which is where the user (me) writes all the required code treating it like a the main function of my code.
Hope the poor explaniation of what i am trying to do helps.
the compile log is below.
Version: Dev-C++ 4.9.9.0
Compile LOG:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\projects\myCGI\Makefile.win"
Executing make clean
rm -f myCGI.o CGIC.o myCGI.exe
gcc.exe -c myCGI.c -o myCGI.o -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/projects/myCGI" -ansi
gcc.exe -c CGIC.C -o CGIC.o -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/projects/myCGI" -ansi
gcc.exe myCGI.o CGIC.o -o "myCGI.exe" -L"C:/Dev-Cpp/lib" -L"C:/mysql/lib" -lmysql
myCGI.o(.text+0xa6):myCGI.c: undefined reference to `cgiHeaderContentType'
myCGI.o(.text+0x135):myCGI.c: undefined reference to `cgiFormStringNoNewlines'
myCGI.o(.text+0x19b):myCGI.c: undefined reference to `cgiFormString'
myCGI.o(.text+0x1fb):myCGI.c: undefined reference to `cgiFormCheckboxSingle'
myCGI.o(.text+0x2a3):myCGI.c: undefined reference to `cgiFormDoubleBounded'
myCGI.o(.text+0x304):myCGI.c: undefined reference to `cgiFormInteger'
myCGI.o(.text+0x377):myCGI.c: undefined reference to `cgiFormSelectSingle'
myCGI.o(.text+0x445):myCGI.c: undefined reference to `cgiFormSelectMultiple'
myCGI.o(.text+0x58f):myCGI.c: undefined reference to `cgiFormRadio'
myCGI.o(.text+0x5cd):myCGI.c: undefined reference to `cgiFormString'
myCGI.o(.text+0x69e):myCGI.c: undefined reference to `cgiFormCheckboxMultiple'
myCGI.o(.text+0x76b):myCGI.c: undefined reference to `cgiFormStringMultiple'
myCGI.o(.text+0x824):myCGI.c: undefined reference to `cgiStringArrayFree'
CGIC.o(.text+0x3c3):CGIC.C: undefined reference to `cgiMain()'
make.exe: *** [myCGI.exe] Error 1
Execution terminated
Execution terminated
http://www14.brinkster.com/aditsu/dev-cpp-faq.html#link
Adrian
OP --
Looks to me as though you need to build the cgic library/archive, link it in your Projects and *also* add cgic.c with your source in those Projects. Seems a little odd, but but it apparently has something to do with the cgiMain stuff. Read the documentation carefully, and see Adrian's FAQ, as well....
-- Jim.