PDA

View Full Version : stupid question about C and openGL



jojozhong
08-31-2000, 04:46 PM
I am just green hand to OPENGL, but now I got a stupid question about C programming.

I use unix, after I use cc to compile the file, how can get the *.o file run? Or i should use some makefile to creat a runable file?

Please tell me in detail.

john
08-31-2000, 05:59 PM
hahahahaha
=)

(no. sorry=)

uhm, you can't run the object files. you need to link them into an executable =)

if you did this:

cc main.c -o myProg

then you'll get a main.o (ie. main.c compiled) and an executable called myProg. (If you omit the -o <filename> you'll get an executable a.out).

if you did this, tho'"

cc -c main.c

you'll compile main.c into main.o, but it won't link the object file into an executable...

if you want to link all your .o files together, you'd do:

cc main.o

hmm. hope this makes sense

cheers,
John

jojozhong
08-31-2000, 07:49 PM
Thanks a lot