To compile a C or C++ program:
% gcc file.cor
% g++ file.cThis compiles file.c into an executable binary named a.out.
Here are a few options to gcc and g++:
- -o outputfile
- To specify the name of the output file. The executable will be named a.out unless you use this option.
- % g++ file.c -o test
- -g
- To compile with debugging flags, for use with gdb.
- -L dir
- To specify directories for the linker to search for the library files.
- -l library
- This specifies a library to link with.
- -I dir
- This specifies a directories for the compile to search for when looking for include files.
没有评论:
发表评论