1/24/2012

g++生成a.out以外的执行文件


To compile a C or C++ program:
% gcc file.c
or
% g++ file.c
This 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.

没有评论: