If there is just a Makefile, try executing 'make', 'make all', and 'make progname' in that order. Otherwise, you'll have to invoke gcc manually: if the source is in foo.c, try:


gcc -c foo.c -o foo
gcc foo.o -o foo


to produce an executable called foo.


If you can't find anything it is likely that you are supposed to run the compiler 'bare' on the source file. This is all the more likely if there's just a single *.c file. To do this:


gcc -o new_name file.c


'-o new_name' defines the name of the resulting binary. Omit the '-o' option if the directory contains more than one *.c (*.cc, *.cxx) file. In this case, the resulting binary will get the standard name 'a.out'. You might want to rename a.out to something more useful to you.


If you need to define extra include or library directories, or libraries, you have to do so by providing them as command line options to gcc directly, e.g.:


gcc -o new_name file.c -L/path/dir -llib -I/path/dir, capital el, lowercase el, capital i


Next Section:  How To Make A Package (9 of 11)



This Web Site Copyright © 1997 - 2008
by Alan Pae - All Rights Reserved