用Code::Blocks完全替代VC6的IDE

平时编程主要用VC6,对后来的VS2003,05,08,10那些编译器不太感冒,因为他们都太庞大了,当然我知道VC6支持的SDK和
C++语言特性都比较老,但是它轻巧的体积和生成的小文件还是让我一直坚守阵地。
但是VC6的IDE还是太老了,不仅需要安装一些第三方的插件才能支持函数跳转、显示行号和TabPage等基本特性,而且其还跟
微软自己的软件Visio冲突,就是打开文件就会崩溃,有时IDE还会出现编译不能结束的问题,真是忍很久了。
在CSDN看到这个帖子:http://topic.csdn.net/u/20100530/13/ca911c06-e217-418a-85ff-155e99273f2f.html
他推荐了Code::Blocks这个跨平台的IDE,提供的包里集成了VC2010的编译器,试用了一下,感觉不错,就有了
集成VC6的想法,过程很简单,把VC6安装目录的VC98文件夹整体copy过去,然后设置一下路径就可以了,
因为平时用MFC和ATL都比较多,所以将他们的include和lib路径加入。偶尔还会用到platform SDK。也把他的路径设置好。
然后编译了一些复杂的应用,都没有问题。
然后就发现Code::Blocks替代VC6 IDE的最大障碍- Debug。Code::Blocks里集成的windbg居然不能调试VC6的文件,
查了Code::Blocks的官网,也说只能集成VC6,但不支持调试。于是花了点时间研究这个问题,发现同样的代码,用
VC2010编译后windbg集成在Code::Blocks中的cdb就可以调试,单步,查询变量均正常,但是用VC6编译后可以单步,
但不能显示变量内容地址等。网上找了找解决方案,用人说设Debug Info参数为/Z7 (C 7.0- Compatible)就可以让windbg
调试VC6的代码了,实际测试,发现windbg确实正常了,但Code::Blocks却不能单步执行代码,仔细分析问题,是与VC6
默认PDB文件处理有关系的。于是看到这个参数 /PDBTYPE.
下面是解决Code::Blocks调试VC6代码的编译参数设置: /ZI  /PDBTYPE:CON
 
官方的说明:
/ZI
Program Database for "Edit & Continue"
Produces a program database, as described above, in a format that supports the Edit and Continue feature. If you want to use Edit and Continue debugging, you must use this option. Use of the /ZI switch will disable any #pragma optimize statements in your code.
/PDBTYPE:{CON[SOLIDATE]|SEPT[YPES]}
Use this linker option to control in which Program Database (PDB) to store the debug type information.
On the command line, the /PDBTYPE option can take one of the following arguments:
Use /PDBTYPE:CON[SOLIDATE] to tell the linker to place the debug type information in a single .PDB file. This option is the default. This option cannot be used if /PDB:NONE is specified.
 只要设置了这两个参数,Code::Blocks就可以在IDE中调试VC6代码了,至此Code::Blocks已经完全替代了VC6。
原文地址:https://www.cnblogs.com/huapox/p/3299826.html