Windows下使用vim编写代码,使用nmake编译代码,使用vs来调试代码
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 第二版》
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来调试代码的更多相关文章
- [vim配置]windows下在vim中使用gcc/g++编译调试c/cpp文件
在Linux里面混了一个多月,vim编程用得甚爽.无奈前天将Linux里面的编程文件夹误删,而技术不精无法找回,悲痛欲绝.再者,无限怀念windows里面的游戏,并觉得现在在Linux里面也学不到什么 ...
- 第21月第9日 windows下使用vim+ctags+taglist
1. windows下使用vim+ctags+taglist 最近在公司的同事指导下,学会使用这个东西编写代码,效率提高了不少.所以记录下来,方便大家使用. 1. 下载gvim74.exe文件,并安装 ...
- Windows 下的 Makefile 编写
Windows 下的 Makefile 编写(一)Makefile的基本规则 作者:cntrump Makefile对于很多人来说是陌生的,特别是习惯于使用 IDE 的人来说,似乎没有听说过 Make ...
- windows下vi/vim编辑器的基本操作
windows下vi/vim编辑器的基本操作 Contents 1. 工具准备(下载gvim) 2. vi/vim基本入门 2.1. 安装 2.2. 基本使用 3. vi/vim基本命令表 1 工具准 ...
- windows下使用vscode编写运行以及调试Python
更新于2018年10月: 首先去python官网下载python3 地址:https://www.python.org/downloads/windows/ 下载好后直接安装 记得勾选添加环境变量 ...
- Ubuntu下终端Vim编写C语言程序 AAAAA
我是开虚拟机下的Ubuntu,装双系统又卸了,Ubuntu默认是不包含编辑器vim和编译器gcc.如果你是刚安装好的Ubuntu电脑,下面我们将来实现自己的第一个程序. 1.准备工作 首先进入root ...
- windows 下 gvim/vim lua支持问题,neocomplete等插件支持
此文是按照知乎 https://www.zhihu.com/question/29333426 "windows下vim的lua支持问题?" 一文汇总的解决方案. 题主提供了不错的 ...
- Windows下使用Vim极简入门
0.下载与安装 在vim官网下载 1.Vim常见的几种模式: 一般模式:主要用于浏览,不能随意删除.修改等.按Esc进入该模式. 插入模式:类似平常我们打开记事本后所在的模式.在命令模式下按i进入. ...
- windows下使用vscode编写运行以及调试C/C++
未经允许,禁止转载,唯一出处:tangming博客园 最后更新于2019年4月4日: 多次更新,内容较多,篇幅较大,但如果是喜欢visual stdio code这款编辑器的话建议仔细阅读,有疑问的地 ...
随机推荐
- lambda表达式转换sql
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; usin ...
- Ubuntu12安装RobotFramework
安装Python Ubuntu默认已安装 安装pip wget https://bootstrap.pypa.io/get-pip.py python get-pip.pysudo apt-get i ...
- Python Flask 在Sina App Engine (SAE)上安家
早就听说了Python的大名,随着的编程语言的理解加深,越发认为动态语言的威力--真大呀. 趁这段时间不忙,我也用Python写了一个应用,而且将其部署到Sina App Engine (SAE).S ...
- php计算两个经纬度地点之间的距离(转)
php计算两个指定的经纬度地点之间的距离,这个在做计算给定某个地点的经纬度,计算其附近的商业区,以及给定地点与附近各商业区之间的距离的时候,还是用的到的.下面是具体的函数代码以及用法示例. 关于如何获 ...
- IT痴汉的工作现状10-Sprint Planning
这是我们的第四个Sprint了.因为上一个迭代周期的失利,Leader群发邮件这样描写叙述道:"对任务的乐观预计,导致Sprint 3没有如期完毕. 我们须要在这次Sprint计划中细致评估 ...
- maven依赖本地非repository中的jar包【转】
今天在使用maven编译打包一个web应用的时候,碰到一个问题: 项目在开发是引入了依赖jar包,放在了WEB-INF/lib目录下,并通过buildpath中将web libariary导入. 在e ...
- 用 Apache POI 读取 XLSX 数据
最近因为项目的原因,需要从一些 Microsoft Office Excel 文件读取数据并加载到数据库. Google了一下方法,发现其实可以用的 Java 第三方库很多,最著名的是 Apache ...
- BCH硬分叉,BitcoinABC强势逆袭BitcoinSV
最近币圈讨论最多的就是BCH的硬分叉,今天凌晨BCH硬分叉在众多币圈大佬关注下落下帷幕,此次分叉大站BitcoinABC强势完胜BitcoinSV.吴忌寒在推特上表示:祝贺!在这个新的区块之后 ...
- High Performance Browser Networking
Chapter 1. Primer on Latency and Bandwidth As a result, to improve performance of our applications, ...
- 冷门PHP函数汇总
概述 整理一些日常生活中基本用不到的PHP函数,也可以说在框架内基本都内置了,无需我们去自行使用的函数.量不多.后续在日常开发中如遇到更多的冷门,会更新本文章 sys_getloadavg 获取系统的 ...