如何设置Visual Studio 2012 RC编译器Qt而不是MinGW? [英] How to set Visual Studio 2012 RC Compiler for Qt instead of MinGW?

查看:637
本文介绍了如何设置Visual Studio 2012 RC编译器Qt而不是MinGW?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows 8 x86;
Qt 4.8.2;
Visual Studio Ultimate 2012 RC

Windows 8 x86; Qt 4.8.2; Visual Studio Ultimate 2012 RC

推荐答案

据我所知,Qt还不支持Visual Studio 2012 RC。但是,我设法使用Visual Studio 2011测试版(Visual Studio 2012 RC的前身 - 他们只是决定重命名)自己构建Qt 4.8。它需要在编译之前对Qt源代码进行一些更改。下面是我使用的步骤:

As far as I know Qt does not yet support Visual Studio 2012 RC. However, I managed to build Qt 4.8 with Visual Studio 2011 beta (the predecessor to Visual Studio 2012 RC - they just decided to rename it) myself. It required making some changes to Qt source code before compiling. Here are the steps I used:


  • 将mkspecs / win32-msvc2010复制到mkspecs / win32-msvc2012并编辑qmake.conf文件_MSC_VER = 1700。

  • 在提取的目录中的所有文件中搜索msvc2010,并修补〜10个地方以了解msvc2012

  • 在Visual Studio命令shell中,cd到tools / configure,运行以前版本的qmake(你需要已经有),然后运行nmake更新你的configure.exe。

  • 在所有文件中搜索make_pair<并删除模板参数。

    • 这在VS 2012中可能不需要;

    • Copy mkspecs/win32-msvc2010 to mkspecs/win32-msvc2012 and edit the qmake.conf file to specify _MSC_VER=1700.
    • Search for "msvc2010" in all files in the extracted directory and patch the ~10 places to also understand "msvc2012"
    • In a Visual Studio command shell, cd to tools/configure, run a previous version of qmake (which you need to already have), and then run nmake to update your configure.exe.
    • Search for "make_pair<" in all files and remove the template arguments.
      • This may not be required in VS 2012; in VS 2011-beta I got compile errors with make_pair when template arguments were specified.

      • [可选]添加-nomake demos -nomake examples到命令行以节省构建时间,和/或'-mp'并行构建

      它花了一些工作,但它为我工作,我现在有几十个Qt应用程序启动和运行,所以我想我会与任何人谁想要构建Qt 4.8.x在Visual Studio 11(Visual Studio 2011 beta或Visual Studio 2012 RC。)

      It took a little work but it worked for me and I now have dozens of Qt applications up and running, so I figured I'd share with anyone else who wants to build Qt 4.8.x on Visual Studio 11 (Visual Studio 2011 beta or Visual Studio 2012 RC.)

      如果这看起来太复杂,只是等待一会儿;我确信Qt将很快支持Visual Studio 2012。

      If this seems too complicated, just wait a bit; I'm sure Qt will support Visual Studio 2012 soon.

      这篇关于如何设置Visual Studio 2012 RC编译器Qt而不是MinGW?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆