undefined reference problem
Hi all,
compiler is reporting error as undefined reference to `svm_check_parameter' here is my code Code:
/********svm.h**************/ thanx for sharing your time..... |
Quote:
|
how can i generate the object file of svm.cpp since i dont have main function written in svm.cpp
the compiler will report error as /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crt1.o: In function `_start': (.text+0x18): undefined reference to `main' collect2: ld returned 1 exit status im compiling by giving g++ -o svm svm.cpp |
Code:
g++ -W -Wall -pedantic -g -o svm.o -c svm.cpp |
thanx lot for providing me the hint ,it helped me a lot.................
actually i have to compile using Code:
g++ -fPIC -c svm.cpp |
Well, -fPIC is not essential, when building an executable, but it doesn't hurt either. Don't omit the '-W -Wall -pedantic' part though, it will save your life many times. The same goes for the '-g' which enables debugging.
|
All times are GMT -5. The time now is 07:30 PM. |