How to use Qt5 and Qt Creator 2.6.1 with compiler from VS 2012?

The official downloads only include Qt libraries 5.0.0 for VS 2010 now. I tried them in VS 2012 Express but got an error message as "error: LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700'..."

Do I have to install VS 2010 or compile the entire source code of Qt5 in VS 2012?

UPDATE: My IDE is Qt Creator 2.6.1. I only use the C++ compiler in VS 2012 because there are no Qt libraries 5.0.0 for minGW in the official downloads yet.

UPDATE-2(2013-1-1): Saw it today, the official blog says:

There are a few things we're still working on for the 5.0 series. We have bugs that we want to fix. We currently do not have binary packages for MinGW (as WebKit doesn't yet work with it yet) and MSVC 2012 (you'll need to compile from source), and we'll work on delivering these as soon as possible. The current plan is to have a first patch level release, 5.0.1, some time before the end of January.

UPDATE-3(2013-1-31): That comes finally, but only adds Qt 5.0.1 for MinGW 4.7.

UPDATE-4(2013-7-06): After a long wait, Qt 5.1.0 for Windows 32-bit (VS 2012, 511 MB) added.


You are right - if you want to use MS VC 2012 compiler, you have to compile QT5 libraries manually. The tutorial can be found on http://qt-project.org/wiki/Building_Qt_5_from_Git. Another option is to install VS 2010 and use it until Digia will make pre-compiled VC 2012 and MinGW libraries. If you use QT Creator as your primary IDE, it should be enough to install VC 2010 Express only.


What do you have set in Visual Studio 2012 ?

Project properties > General > Platform toolset

Try setting it to v110 .

More info at MSDN.

链接地址: http://www.djcxy.com/p/68612.html

上一篇: 编译器配置为Qt Creator

下一篇: 如何通过VS 2012的编译器使用Qt5和Qt Creator 2.6.1?