gcc/g++ 命令的常用选项使用g++编译CPP文件如果用gcc编译C++源文件时,加以下选项:-lstdc++,否则使用了C++操作的文件编译会出错.假如在程序中用到new delete操作,而不加此选项进行编译会出现以下错误信息:zch07eha01:/home/mrbt48/cpp> gcc -o RG RandomTest.cpp/tmp/cciMHHyb.o(.text+0x2b): In function `main':: undefined reference to `opera…
四种编译优化类型的解释: `-O ' `-O1 ' Optimize. Optimizing compilation takes somewhat more time, and a lot more memory for a large function. With `-O ', the compiler tries …