ubuntu下用g++同时编译多个文件的方法

来源:互联网 发布:微信矩阵怎么弄 编辑:程序博客网 时间:2024/06/09 12:35
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 //用*号代替目录下所有要编译的文件
0 0
原创粉丝点击