g++编译链接

编译生成.o文件,其中第二条命令指定使用dwarf2编译:

g++ -c test.cpp
g++ -g3 -gdwarf-2 -c test.cpp

使用.o文件生成可执行程序:

g++ test.o -o test

直接生成可执行文件:

g++ test.cpp -o test

猜你喜欢

转载自blog.csdn.net/zhang_han666/article/details/80267342