Chinaunix首页 | 论坛 | 博客
  • 博客访问: 699327
  • 博文数量: 113
  • 博客积分: 7070
  • 博客等级: 少将
  • 技术积分: 930
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-02 21:03
文章分类

全部博文(113)

文章存档

2012年(2)

2011年(10)

2010年(19)

2009年(39)

2008年(20)

2007年(23)

我的朋友

分类: 嵌入式

2011-05-05 12:19:33

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, (  refers to the path where visual studio is installed, for mine, its (E:\Microsoft Visual Studio 8\)

Compiler

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

Linker

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

Resource Compiler

  • VC\include

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

In additional paths,

  • Common7\IDE
  • 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.


阅读(814) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~