View Single Post
Old 08-14-2002, 12:07 AM   #17 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
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
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote