SPRUIG8J January 2018 – March 2024
The input files that you specify on the command line can be C source files, C++ source files, or object files. The compiler uses filename extensions to determine the file type.
Extension | File Type |
---|---|
.c | C source |
.C | Depends on operating system |
.cpp, .cxx, .cc | C++ source |
.obj .c.obj .cpp.obj .o* .dll .so | Object |
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 files, see Section 3.3.11.
You can use wildcard characters to compile 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:
cl7x *.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.