Click to See Complete Forum and Search --> : compiling .c for first time


MDMA_Zer0
10-21-2002, 10:01 PM
ok, I have some code I want to compile into a script -please bear with me I'm very new to linux/coding- the file is in a dirrectory called /code, in .c format.

how do I go about debuging/compiling this ?

I've tryed messing around with the "make command" but have had no luck i.e. " make apache_script.c "

I've also used Emacs, but become much more comfused after trying to compile it there. Can some one help me? Thank you

Sawdusty
10-21-2002, 10:31 PM
if it's a simple file,

gcc -o nameofbinary sourcefile.c

should do the trick. However, if it's complex and needs dynamic libraries, you'll have to pass gcc other options, including include files and libraries. I'm definately not the one to help there.

make doesn't work unless there is a makefile with calls to gcc in it. Read 'man make' for more info. Also, 'man gcc' should do the trick, as well as a google search for tutorials on both utilities.

I don't do much c programming, so that's all I can give you.

Dusty