delorie.com/djgpp/faq/dev-probs/extensions.html | search |
I type "GCC PROG.C" to compile a C program which I already remember to pass compilation without a single warning, and suddenly it gives all kinds of strange error messages and unresolved externals.
That's because you typed your source file extension in upper case. gcc is not case insensitive about filenames like DOS is, and it uses the file's extension to determine how to compile a file. Valid extensions are:
In the examples above, PROG.C is taken as C++ program, not a C one, and PROG.CC is passed to the linker as if it were an object file.
You can override the default rules gcc uses to decide how each input file should be treated, with the help of ``-x LANGUAGE'' switch. For instance, the command
gcc -x c++ prog.ccompiles prog.c as a C++ source. See gcc docs for more info on -x options.
webmaster | delorie software privacy |
Copyright © 1995 | Updated Feb 1995 |