For this example the files are placed in the /CppFiles directory. Use the cd command to get into the folder containing the source files.
To compile the program by listing the files on the command line, type:
方法一:g++ Hello.cpp Welcome2.cpp -o Welcome2.out -ansi //两个cpp源文件,编译后只生成一个 .out 文件
方法二:To compile the program using the wild-card character, type:
g++ *.cpp -o Welcome2.out -ansi //用*号代替目录下所有要编译的文件
ubuntu下用g++同时编译多个文件的方法
于 2016-03-21 19:58:38 首次发布