LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   undefined reference error (https://www.linuxquestions.org/questions/programming-9/undefined-reference-error-467655/)

bahadur 07-25-2006 08:50 PM

undefined reference error
 
I am trying to compile a c++ program and here is the error i am getting

Quote:

junaid@Dev-jsahibzada:~/www/c2php$ gcc -o c2php *.cpp -I${SSC_HOME}/include ${SSC_HOME}/lib/libwasp.so ${SSC_HOME}/lib/libwasp_stl.so
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/crt1.o: In function `_start':../sysdeps/i386/elf/start.S:115: undefined reference to `main'
collect2: ld returned 1 exit status
even if i use g++ i get the same thing

Quote:

junaid@Dev-jsahibzada:~/www/c2php$ g++ -o c2php *.cpp -I${SSC_HOME}/include ${SSC_HOME}/lib/libwasp.so ${SSC_HOME}/lib/libwasp_stl.so
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../lib/crt1.o: In function `_start':../sysdeps/i386/elf/start.S:115: undefined reference to `main'
collect2: ld returned 1 exit status
please tell me whats wrong.

Matir 07-25-2006 08:56 PM

This may seem stupid, but does one of your .cpp files contain a main function?

bahadur 07-25-2006 09:02 PM

ooooooops it doesnt.

i am using this tool provided by systinet.com to convert a wsdl file into corresponding C++ stub skeleton.

when i use this tool on wsdl file it gives me the following files.

c2php.cpp
c2php.h
c2phpImpl.cpp
c2phpImpl.h
c2phpStructs.cpp
c2phpStructs.h

now according to the documentation was simply supposed to compile them and use them.

i didnt know that i had to write my own main() to make things work.

tuxdev 07-25-2006 09:08 PM

What kind of things are the files? If they were black-box modules, you would still have to write a C++ driver for it all. "use" and "run" are two different things, programming-wise.

Matir 07-25-2006 09:15 PM

Agreed. Never seen that tool before, looks kindof interesting.

bahadur 07-25-2006 09:18 PM

u can get the tool from here

http://www.systinet.com/products/ssc/overview


it converts a wsdl file into c++ code.

the tutorials are over here

http://www.systinet.com/resources/tutorials


All times are GMT -5. The time now is 06:27 AM.