简体   繁体   English

如何为Qt而不是MinGW设置Visual Studio 2012 RC编译器?

[英]How to set Visual Studio 2012 RC Compiler for Qt instead of MinGW?

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

As far as I know Qt does not yet support Visual Studio 2012 RC. 据我所知,Qt尚不支持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. 但是,我设法用Visual Studio 2011 beta(Visual Studio 2012 RC的前身 - 他们只是决定重命名它)自己构建Qt 4.8。 It required making some changes to Qt source code before compiling. 它需要在编译之前对Qt源代码进行一些更改。 Here are the steps I used: 以下是我使用的步骤:

  • Copy mkspecs/win32-msvc2010 to mkspecs/win32-msvc2012 and edit the qmake.conf file to specify _MSC_VER=1700. 将mkspecs / win32-msvc2010复制到mkspecs / win32-msvc2012并编辑qmake.conf文件以指定_MSC_VER = 1700。
  • Search for “msvc2010” in all files in the extracted directory and patch the ~10 places to also understand “msvc2012” 在解压缩目录中的所有文件中搜索“msvc2010”并修补~10个地方也要了解“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. 在Visual Studio命令shell中,cd到tools / configure,运行以前版本的qmake(您需要已经拥有),然后运行nmake来更新configure.exe。
  • Search for “make_pair<” in all files and remove the template arguments. 在所有文件中搜索“make_pair <”并删除模板参数。
    • This may not be required in VS 2012; 在VS 2012中可能不需要这样做; in VS 2011-beta I got compile errors with make_pair when template arguments were specified. 在VS 2011-beta中,当指定模板参数时,我在make_pair中遇到编译错误。
  • In src\\3rdparty\\javascriptcore\\JavaScriptCore\\runtime\\Structure.{h,cpp} change the make_pair calls to explicit JSC::StructureTransitionTableHash::Key constructor calls. 在src \\ 3rdparty \\ javascriptcore \\ JavaScriptCore \\ runtime \\ Structure。{h,cpp}中将make_pair调用更改为显式JSC :: StructureTransitionTableHash :: Key构造函数调用。
  • Edit src\\3rdparty\\clucene\\src\\CLucene\\config\\define_std.h to comment out _CL_HAVE_HASH_MAP and _CL_HAVE_HASH_SET 编辑src \\ 3rdparty \\ clucene \\ src \\ CLucene \\ config \\ define_std.h以注释_CL_HAVE_HASH_MAP和_CL_HAVE_HASH_SET
  • In a Visual Studio command shell, run the configure program that is installed with the source, eg: configure.exe -debug-and-release -platform win32-msvc2012 -opensource 在Visual Studio命令shell中,运行随源安装的configure程序,例如:configure.exe -debug-and-release -platform win32-msvc2012 -opensource
    • [Optionally] add '-nomake demos -nomake examples' to the command line to save build time, and/or '-mp' to build in parallel [可选]将'-nomake demos -nomake examples'添加到命令行以节省构建时间,和/或'-mp'并行构建
  • When the configure is complete, type nmake to start the build. 配置完成后,键入nmake以启动构建。 This will build debug and release versions of all the libraries as well as release versions of all the tools (designer, etc.). 这将构建所有库的调试版和发行版以及所有工具的发布版本(设计器等)。

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 11上构建Qt 4.8.x的人分享(Visual Studio 2011 beta或Visual Studio 2012 RC。)

If this seems too complicated, just wait a bit; 如果这看起来太复杂,那就等一下; I'm sure Qt will support Visual Studio 2012 soon. 我相信Qt很快就会支持Visual Studio 2012。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么round()是mingw知道的,而不是visual studio编译器 - Why round() is known by mingw but not by visual studio compiler 如何使Visual Studio 2012调用本机64位Visual C ++编译器而不是32位x64交叉编译器? - How to make Visual Studio 2012 call the native 64-bit Visual C++ compiler instead of the 32-bit x64 cross-compiler? 如何使用Visual Studio 2012 c ++为VIX API配置编译器? - How to configure compiler for VIX API with Visual Studio 2012 c++? 使用Visual Studio 2012的编译器制作Windows XP的Qt应用程序 - Using Visual Studio 2012's compiler to make Qt applications for Windows XP 如何在Qt .pro文件中知道Visual Studio是否为编译器? - How to know in a Qt .pro file if visual studio is the compiler? Linux上的Visual Studio 2012编译器替代方案? - Visual Studio 2012 compiler alternative on Linux? 在Visual Studio 2012中,如何使用C ++ DLL链接资源文件(.rc) - In Visual Studio 2012, how can one link resource file(.rc) with c ++ dll Visual Studio 2012 + qt + clang,有可能吗? - Visual studio 2012 + qt + clang, is it possible? Windows在Visual Studio 2012 RC中形成CLR应用程序? - windows form CLR application in Visual studio 2012 RC? C ++中的XAML桌面应用程序(Visual Studio Ultimate 2012 RC) - XAML Desktop Apps in C++ (Visual Studio Ultimate 2012 RC)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM