3. Use of gcc/g++
- gcc is the "GNU Compiler Collection", originally called the "GNU C compiler".
-
gcc is commonly invoked from the command line, like so:
gcc [ option | filename ]...
-
One would normally use gcc like so:
gcc [flags] file1 [file2 [file3 ...]] [-o output_file]
Where file1 file2 etc. are input files, either C source files or pre-compiled object files.
- Example: gcc foo1.c foo2.c -o foo
- The default executable output filename is a.out. When producing object files, the default output for each input file has the suffix .o .