有时候,我们在用vs2008调试的时候,会出现断点无效。如下图:
![c51ccfa9517758dfe85e5daf9656870a.png](https://img-blog.csdnimg.cn/img_convert/c51ccfa9517758dfe85e5daf9656870a.png)
程序断点进不去
第一反应,要看想一下是不是在debug下。如果在Release下(适用VS2005/VS2008),
在当前工程点击右键选择properties,选择 All Configurations
- C++>General->Debug Information Format->Program Database (/Zi)
- C++>Optimization->Optimization->Disabled (/Od)
- Linker->Debugging->Generate Debug Info->Yes (/DEBUG)
- Linker->Debugging->Generate Program Database File->$(TargetDir)$(TargetName).pdb
如果是在debug下:
1.检查工程配置是否设置正确。
- C++>General->Debug Information Format->Program Database (/Zi)
- C++>Optimization->Optimization->Disabled (/Od)
- Linker->Debugging->Generate Debug Info->Yes (/DEBUG)
- Linker->Debugging->Generate Program Database File->$(TargetDir)$(TargetName).pdb
1.如果工程配置没问题,请打开:
Tools->Option->debugging->General 找到 Require source files to exactly match the original version 不要打勾
即:工具->选项->调试里->常规 找到 要求原文件与原始版本完全匹配 不要打勾
再调试一下试试,应该可以了。
如果不行,清一下工程,试试。