首页 > 系统相关 >Windows下使用vim编写代码,使用nmake编译代码,使用vs来调试代码

Windows下使用vim编写代码,使用nmake编译代码,使用vs来调试代码

时间:2022-12-07 15:32:08浏览次数:61  
标签:exe StdAfx nmake 代码 program 使用 obj Hello name


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


 

标签:exe,StdAfx,nmake,代码,program,使用,obj,Hello,name
From: https://blog.51cto.com/u_15905375/5919619

相关文章

  • 记录:nvm 安装与使用
    遇到新老项目使用的node版本不一致时,为了方便版本切换所以使用了node版本管理工具--nvm一、nvm安装下载下载:https://github.com/coreybutler/nvm-windows/releases......
  • firewalld使用与配置
    #永久添加指定的端口策略firewall-cmd--zone=public--add-port=80/tcp--permanent#永久删除指定的端口策略firewall-cmd--zone=public--remove-port=80/tcp--pe......
  • ASTyle代码格式整理
    ASTyle是一个很好用的代码格式整理工具,适合整理对齐凌乱的代码,此工具只调整格式,不会更改代码。丰富的参数,可以个性化自己喜欢的格式,以下我本人喜欢的参数。一、下载ASTyle......
  • Example的使用
    介绍MyBatis的逆向工程中会生成实例及实例对应的example,example用于添加条件,相当where后面的部分。Example中的构造方法/***带exists参数的构造方法,默认notNull为fa......
  • sentry-sdk 使用
    一、代码importosimportrandomimportloggingimportsentry_sdkfromsentry_sdk.tracingimportTransactionfromsentry_sdk.integrations.loggingimportLoggi......
  • 直播app系统源码,使用scroll-view实现内容列表的竖向滚动
    直播app系统源码,使用scroll-view实现内容列表的竖向滚动app.json{ "pages":[  "pages/index/index" ], "window":{  "navigationBarBackgroundColor":"......
  • 使用vue深度选择器修改ElementUI组件内样式
    例子:el-collapse标签修改子组件样式在带有scoped属性的style中书写样式时,无法作用影响到子组件中的样式,此时我们会使用到deep深度选择器,来解决此问题,我们在使用less预处理......
  • 编译、运行过程如何实现代码行数关联
    背景正在做一款编译器,需要实现编译、运行过程中的错误与源码行列数能够做关联分析编译设计源码,拥有源码的抽象语法树AST,跟源码的行列数是有关联的运行阶段,对于Java来......
  • 【代码优雅】使用OOP消除重复代码
    使用OOP消除重复代码假设银行提供了一些API接口,对参数的序列化有点特殊,不使用JSON,而是需要我们把参数依次拼在一起构成一个大字符串。按照银行提供的API文档的顺序,把所......
  • 当自动建表时,一定要使用@Column(columnDefinition = "longtext")规范好字段的数据类型
    @IdprivateStringid;privateIntegersimilarity;privateIntegertotalLine;@Column(name="code_snippet",columnDefinition="longtext")......