codeblocks+QT+vs2010集成编译环境的搭建

环境搭建目标: 在winxp下的codeblocks里面编辑QT的应用程序,并在codeblocks里直接build.run搭建一个集成开发环境。

第一步安装

安装qt-win-opensource-4.7.4-vs2008;qt-vs-addin-1.1.9 plugin; codeblocks;

把QT安装在codeblocks目录下 

第二步codeblocks qmake的集成

在codeblocks的menu/tool下面加上加入2个tool 一个是Qmake_project, 一个是Qmake如下图

 

 

第三步编写源程序

建立工程属性中加上project parser的一些头文件,并在editor中设置enable headers code-completion,编写相应的程序

project build options把$make -f $makefile $target去掉$target

设置project属性为This is a custom Makefile;Output filename中,bin/debug/projectname.exe改成debug/projectname.exe, 设置相应的编译器为vs2010

写源文件后,点tool/Qmake_project生成 pro文件, 点tool/Qmake生成....Makefile Makefile.debug等;

 

第四步 编译

调用相应的编译器调用makefile了,有3种方法:

法1可以调用vs2008编译运行,因为集成QT了

法2安装vs2010,设置环境变量

设在Code::Blocks内不起作用,设在环境变量里面;或者每次在makefile里面设置

PATH: C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE;C:\Program Files\Microsoft Visual Studio 10.0\VC\bin;C:\Program Files\IDM Computer Solutions\UltraEdit\;C:\MinGW\bin;C:\MinGW\libexec\gcc\mingw32\4.5.2;C:\MinGW\mingw32\bin;C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin;C:\CB_20110815_rev7385_win32\QT\bin (for nmake.exe)

INCLUDE: C:\Program Files\Microsoft Visual Studio 10.0\VC\include;C:\CB_20110815_rev7385_win32\QT\include;C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include;C:\MinGW\include

LIB: C:\Program Files\Microsoft Visual Studio 10.0\VC\lib;C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib;C:\CB_20110815_rev7385_win32\QT\lib;C:\MinGW\lib

直接点build就可以。(要相应)

法3进入Visual Studio 命令提示(2010) 或者运行C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat

输入nmake -f Makefile.debug即可

 

第五步 运行

点击运行会出现错误“由于应用程序配置不正确,应用程序未能启动”

查看了一下test2.intermediate.manifest文件

<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level='asInvoker' uiAccess='false' />
      </requestedPrivileges>
    </security>
  </trustInfo>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*' />
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.VC90.DebugCRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
    </dependentAssembly>
  </dependency>
</assembly>
发现调用的vc9.0的CRT (c run time)正在修复错误中...

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值