Search notes:
gcc -x
Force the compiler to compile in the specified language. Without this flag, gcc determines the language by the source file's suffex.
In the following example, foo.cpp
is treated as a c file rather than a c++ file, although its suffix is .cpp
:
$ gcc -x c foo.cpp
Possible values for the language are:
- c
- c-header: precompiled header file
- cpp-output
- c++
- c++-header
- c++-cpp-output
- objective-c
- objective-c-header
- objective-c-cpp-output
- objective-c++
- objective-c++-header
- objective-c++-cpp-output
- assembler
- assembler-with-cpp
- ada
- f77
- f77-cpp-input
- f95
- f95-cpp-input
- go
- brig