SPRUI04F july 2015 – april 2023
The input files that you specify on the command line can be C source files, C++ source files, assembly source files, linear assembly files, or object files. The compiler uses filename extensions to determine the file type.
Extension | File Type |
---|---|
.asm, .abs, or .s* (extension begins with s) | Assembly source |
.c | C source |
.C | Depends on operating system |
.cpp, .cxx, .cc | C++ source |
.obj .c.obj .cpp.obj .o* .dll .so | Object |
.sa | Linear assembly |
Case Sensitivity in Filename Extensions: Case sensitivity in filename extensions is determined by your operating system. If your operating system is not case sensitive, a file with a .C extension is interpreted as a C file. If your operating system is case sensitive, a file with a .C extension is interpreted as a C++ file.
For information about how you can alter the way that the compiler interprets individual filenames, see Section 3.3.8. For information about how you can alter the way that the compiler interprets and names the extensions of assembly source and object files, see Section 3.3.11.
You can use wildcard characters to compile or assemble multiple files. Wildcard specifications vary by system; use the appropriate form listed in your operating system manual. For example, to compile all of the files in a directory with the extension .cpp, enter the following:
cl6x *.cpp
No Default Extension for Source Files is Assumed: If you list a filename called example on the command line, the compiler assumes that the entire filename is example not example.c. No default extensions are added onto files that do not contain an extension.