Quote:
Originally posted by w00t
undefined symbol _main in module co.asm
|
You need a main function, when compiling something, else the last linking will return with an error like this.. The compiler dont know where the executable should start, it's looking for a main() somewhere.. Yet can't find it anywhere, thats why it errors out.
If you wan't it to be made out of several files, then compile the ones without a main() with the flag
-c and remember to include their respective header files in the one containing the main() function, and remember to give all the object files along with it's compilation ie.with files like:
myclass.cc, myclass.h, myotherclass.cc, myotherclass.h, mymain.cc
When compiling do:
# for i in *class.cc; do g++ -c $i; done
# g++ -o myproggy *.o mymain.cc
But since you mention you use Kdevelop, it would be easier, just to let that create a Makefile for you, and just use
make all