Windows下使用vim编写代码,使用nmake编译代码,使用vs来调试代码
2017-04-03 15:46
1271 查看
1、编写代码
2、编写Makefile,如果要调试,
2.1、需要在编译的时候加上/Zi ( Generates complete debugging information),编译由cl.exe来完成
2.2、需要在链接选项中指定/DEBUG,(The /DEBUG option creates debugging information for the .exe file or DLL.
The linker puts the debugging information into a program database (PDB). It updates the PDB during subsequent builds of the program.
An .exe file or DLL created for debugging contains the name and path of the corresponding PDB. The debugger reads the embedded name and uses the PDB when you debug the program. The linker uses the base name of the program and the extension .pdb to name the program database, and embeds the path where it was created. To override this default, set /PDB and specify a different file name.)这样就会生成pdb文件,链接由link.exe来完成
3、devevn.exe 执行文件 (打开ide, 在源码文件中打上断点,或参考云风大神的博文:IDE 不是程序员的唯一选择(一),使用中断语句直接在代码中加断点)
以下是一个Makefile文件,来自《深入浅出MFC 第二版》
2、编写Makefile,如果要调试,
2.1、需要在编译的时候加上/Zi ( Generates complete debugging information),编译由cl.exe来完成
2.2、需要在链接选项中指定/DEBUG,(The /DEBUG option creates debugging information for the .exe file or DLL.
The linker puts the debugging information into a program database (PDB). It updates the PDB during subsequent builds of the program.
An .exe file or DLL created for debugging contains the name and path of the corresponding PDB. The debugger reads the embedded name and uses the PDB when you debug the program. The linker uses the base name of the program and the extension .pdb to name the program database, and embeds the path where it was created. To override this default, set /PDB and specify a different file name.)这样就会生成pdb文件,链接由link.exe来完成
3、devevn.exe 执行文件 (打开ide, 在源码文件中打上断点,或参考云风大神的博文:IDE 不是程序员的唯一选择(一),使用中断语句直接在代码中加断点)
以下是一个Makefile文件,来自《深入浅出MFC 第二版》
Hello.exe: StdAfx.obj Hello.obj Hello.res link.exe /nologo /Debug /subsystem:windows /incremental:no \ /machine:I386 /out:"Hello.exe" \ Hello.obj StdAfx.obj Hello.res \ mfc80d.lib StdAfx.obj: StdAfx.cpp StdAfx.h cl.exe /nologo /MDd /W3 /GX /O2 /D "WIN32" /D "DEBUG" /D "_WINDOWS" \ /D "_AFXDLL" /D "_MBCS" /Fp"Hello.pch" /Yc"StdAfx.h" /c StdAfx.cpp Hello.obj: Hello.cpp Hello.h StdAfx.h cl.exe /nologo /MDd /W3 /GX /O2 /D "WIN32" /D "DEBUG" /D "_WINDOWS" \ /D "_AFXDLL" /D "_MBCS" /Fp"Hello.pch" /Yc"StdAfx.h" /c Hello.cpp Hello.res: Hello.rc Hello.ico rc.exe /l 0x404 /Fo"Hello.res" /D "DEBUG" /D "_AFXDLL" Hello.rc Clean: del *.exe *.obj *.res *.manifest *.pch *.pdb
相关文章推荐
- Windows下使用vim编写代码,使用nmake编译代码,使用vs来调试代码
- windows下在vim中使用gcc/g++编译调试c/cpp文件
- 在windows下使用vs2013编译和调试mysql源代码
- 在windows下使用vs2013编译和调试mysql源代码
- 使用eclipse调试cocos2d-x C++ 代码(编写+真机调试,放弃VS)
- 使用eclipse调试cocos2d-x C++ 代码(编写+真机调试,放弃VS)
- 使用eclipse调试cocos2d-x C++ 代码(编写+真机调试,放弃VS)
- windows下在vim中使用gcc/g++编译调试c/cpp文件
- 使用eclipse调试cocos2d-x C++ 代码(编写+真机调试,放弃VS) (转)
- Windows VS2017 下 使用 x265 第二回 x265编译调试续
- 使用eclipse调试cocos2d-x C++ 代码(编写+真机调试,放弃VS)
- 在windows下使用vs2013编译和调试mysql源代码
- 使用eclipse调试cocos2d-x C++ 代码(编写+真机调试,放弃VS)
- [vim配置]windows下在vim中使用gcc/g++编译调试c/cpp文件
- 使用eclipse调试cocos2d-x C++ 代码(编写+真机调试,放弃VS)
- 如何使用Vim编写和调试Python代码
- 使用eclipse调试cocos2d-x C++ 代码(编写+真机调试,放弃VS)
- Windows VS2017 下 使用 x265 第一回 x265编译调试的初体验
- 使用eclipse调试cocos2d-x C++ 代码(编写+真机调试,放弃VS)
- 转:Linux 环境使用vim搭建php IDE -- 提高代码编写数度数倍!手把手教你打造程序员的上古神器VIM!