免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 890 | 回复: 0
打印 上一主题 下一主题

Using Visual Studio 2005 in Code::Blocks [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-21 08:41 |只看该作者 |倒序浏览

I am totally smitten by Code::blocks its too great. However, a lot of libs that i have to use required Visual studio and frankly, using a linux based compiler for windows programming isn’t a nice idea.

After trying visual studio for like 1-2 hrs, i gave it up as bad job. Finally i found how to integrate Visual studio 2005 compilation tools into Code::blocks itself!!

So, I studied imported solution and tried building it, and with some mixing and matching, i am getting fairly consistent results. So, heres the howto:

1. Settings -> Compiler and Debugger

a) Change selected compiler to Visual Studio 2005 / 2008

2. compiler flags:

  • Enable warning level 3
  • I also needed to enable Multi Threaded DLL Debug runtime library for my programs to work
  • In other options , add /EHsc and in Defines, add WIN32 ( for windows programs )

3. In search paths, ( <installdir > refers to the path where visual studio is installed, for mine, its (E:\Microsoft Visual Studio 8\)

Compiler

  • <Installdir>VC\include
  • <Installdir>VC\PlatformSDK\Include
  • Customs ( for me, its C:\Customs\include )
  • Lot more listed in the visual studio options.. add then if needed.

Linker

  • <Installdir>VC\lib
  • <Installdir>VC\PlatformSDK\Lib
  • Customs ( for me, its C:\Customs\lib )

Resource Compiler

  • <Installdir>VC\include

4. Toolchain executables
specify path as <installdir>VC like for me, it says E:\Microsoft Visual Studio 8\VC

In additional paths,

  • <installdir>Common7\IDE
  • <installdir>VC\PlatformSDK\Bin

Other settings:
If you want build log to be saved to html file, then goto other settings tab and enable save build log in html file when build is finished and if needed the sub option too.

There you go! I got my program to compile flawlessly using the above settings, you might need to change some settings according to your taste, however, this is the basic outline.


您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP