cl编译控制台可调式的程序
2009-11-08 15:21
666 查看
元旦要调到新的组,开始系统的学习C++,首选的书籍是《C++ Primer》。系统的学习有个好处就是很系统,尤其是当自己写过一段时间的代码之后帮助尤为明显。
安装了VS2008后,就可以在控制台下面编译自己的代码了首先执行文件:
再执行如下命令,main.cpp是要编译的文件名:
即可以编译生成exe文件。如果想在VC2008中调试代码的话,就是用一下的明令
对应的选项帮助如下:
安装了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++程序
- win7+vs2010+Qt addin新建win32控制台程序编译出错问题
- linux 下调用 cl.exe 编译 MFC 程序脚本
- [wxWidgets] 去除MinGW下编译的wxWidgets程序的控制台窗口
- VS下如何配置才能使用 cl 命令行方式编译 C/C++ 程序
- [wxWidgets] 去除MinGW下编译的wxWidgets程序的控制台窗口
- 利用vc 6.0目录下的cl.exe直接编译程序的方法
- 利用vc 6.0目录下的cl.exe直接编译程序的方法
- 利用vc 6.0目录下的cl.exe直接编译程序的方法
- [JAVA语言学习][小技巧]利用Batch批处理脚本实现控制台快速编译执行JAVA程序
- 使用vs编译程序选择新建”空项目“与”win32控制台应用程序“的区别。
- linux中codeblocks程序编译运行后不出现控制台窗口
- delphi 程序是否为控制台编译选项
- error LNK2001: unresolved external symbol _main(控制台程序与GUI程序编译开关)
- sublime 编译程序出错控制台打印PATH的解决办法
- 利用vc 6.0目录下的cl.exe直接编译程序的方法[整理]
- 如何配置才能使用cl命令编译C/C++程序?
- 用cl工具编译MFC程序
- 用vs2005编译器cl在控制台下编译