cl编译控制台可调式的程序
2012-08-24 19:31
190 查看
元旦要调到新的组,开始系统的学习C++,首选的书籍是《C++ Primer》。系统的学习有个好处就是很系统,尤其是当自己写过一段时间的代码之后帮助尤为明显。
安装了VS2008后,就可以在控制台下面编译自己的代码了首先执行文件:
C:/Program Files/Microsoft Visual Studio 9.0/VC/vcvarsall.bat
再执行如下命令,main.cpp是要编译的文件名:
cl /EHsc main.cpp
即可以编译生成exe文件。如果想在VC2008中调试代码的话,就是用一下的明令
cl main.cpp /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /W3 /nologo /ZI /TP /errorReport:prompt
对应的选项帮助如下:
cl /EHsc main.cpp
/Od disable optimizations (default)
/D<name>{=|#}<text> define macro
/Gm[-] enable minimal rebuild
/EHs enable C++ EH (no SEH exceptions)
/EHc extern "C" defaults to nothrow
/RTC1 Enable fast checks (/RTCsu)
/MDd link with MSVCRTD.LIB debug lib
/w<l><n> set warning level 1-4 for n
/nologo suppress copyright message
/Zi enable debugging information
/Tp<source file> compile file as .cpp
/errorReport:option Report internal compiler errors to Microsoft
none - do not send report
prompt - prompt to immediately send report
queue - at next admin logon, prompt to send report (default)
send - send report automatically
安装了VS2008后,就可以在控制台下面编译自己的代码了首先执行文件:
C:/Program Files/Microsoft Visual Studio 9.0/VC/vcvarsall.bat
再执行如下命令,main.cpp是要编译的文件名:
cl /EHsc main.cpp
即可以编译生成exe文件。如果想在VC2008中调试代码的话,就是用一下的明令
cl main.cpp /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /W3 /nologo /ZI /TP /errorReport:prompt
对应的选项帮助如下:
cl /EHsc main.cpp
/Od disable optimizations (default)
/D<name>{=|#}<text> define macro
/Gm[-] enable minimal rebuild
/EHs enable C++ EH (no SEH exceptions)
/EHc extern "C" defaults to nothrow
/RTC1 Enable fast checks (/RTCsu)
/MDd link with MSVCRTD.LIB debug lib
/w<l><n> set warning level 1-4 for n
/nologo suppress copyright message
/Zi enable debugging information
/Tp<source file> compile file as .cpp
/errorReport:option Report internal compiler errors to Microsoft
none - do not send report
prompt - prompt to immediately send report
queue - at next admin logon, prompt to send report (default)
send - send report automatically
相关文章推荐
- cl编译控制台可调式的程序
- 使用cl.exe在windows控制台下编译C++程序
- 用vs2005编译器cl在控制台下编译
- win7+vs2010+Qt addin新建win32控制台程序编译出错问题
- 利用vc 6.0目录下的cl.exe直接编译程序的方法
- DOS 使用CL命令 编译程序
- 在控制台(Console)环境下编译Windows GUI程序
- [wxWidgets] 去除MinGW下编译的wxWidgets程序的控制台窗口
- Win32 SDK基础(2)—— 自己动手用cl.exe和link.exe编译和连接程序
- 关于解决Win32控制台程序编译后自动退出
- 在控制台(Console)环境下编译Windows GUI程序
- 用mingw编译C++工程;程序里面的cout<<"aaa";cmd运行c++程序,aaa内容在控制台不显示,如何将aaa输出到控制台屏幕并将控制台内容写到一个文件中。
- 在文件夹中 的指定类型文件中 查找字符串(CodeBlocks+GCC编译,控制台程序,仅能在Windows上运行)
- [wxWidgets] 去除MinGW下编译的wxWidgets程序的控制台窗口
- 利用vc 6.0目录下的cl.exe直接编译程序的方法[整理]
- cl.exe(VC编译程序)参数大全
- 在 console(控制台)下编译和运行 Java 程序
- delphi 程序是否为控制台编译选项
- 利用vc 6.0目录下的cl.exe直接编译程序的方法
- 利用vc 6.0目录下的cl.exe直接编译程序的方法