Mail Archives: djgpp/1997/07/19/01:18:15
Bond170 wrote:
>
> I have read readme.1st and faq2.01 and have downloaded the appropriate
> files for C and have unzipped them. my files are in c:\djgpp\... and I
> have saved a program called test.c in c:\cfiles\test.c. Now, how do I
> compile the program. Please answer quickly so that i get the response
> before I throw this computer out my window. Microsoft has their windows,
> I have mine.
Read readme.1st:
GCC is a command-line compiler, which you invoke from DOS command
line. To compile and link a single-file C program, use a command like
this:
gcc myfile.c -o myfile.exe -lm
The -lm links in the lib/libm.a library (trig math) if needed. (Link
order is significant, so if you need libm.a, always put `-lm' at the
end of the command line.)
--snip--
It goes on for several more paragraphs.
The best overall command line to use for most purposes is this:
gcc -Wall -O -g -o myprog.exe myfile.c [file2.c file3.c ...] [-llibrary]
'-Wall' turns on extra warnings. '-O' optimizes your code for size and
speed. '-g' adds extra debugging information. When compiling C++,
replace 'gcc' with 'gxx'. Add libraries only to the end of the command
line.
--
---------------------------------------------------------------------
| John M. Aldrich |"A competent and self-confident person|
| aka Fighteer I | is incapable of jealousy in anything.|
| mailto:fighteer AT cs DOT com | Jealousy is invariably a symptom of |
| http://www.cs.com/fighteer | neurotic insecurity." - Lazarus Long|
---------------------------------------------------------------------
- Raw text -