Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 293
UniversE Avatar asked Dec 20 '12 09:12

UniversE


People also ask

Which compiler is used in Qt?

Qt Creator uses the C++ compiler from the GNU Compiler Collection on Linux. On Windows it can use MinGW or MSVC with the default install and can also use Microsoft Console Debugger when compiled from source code. Clang is also supported.

Does Qt come with a compiler?

Qt is supported on a variety of 32-bit and 64-bit platforms, and can usually be built on each platform with GCC, a vendor-supplied compiler, or a third party compiler. In Qt Creator, a kit specifies the compiler and other necessary tools for building an application for and running it on a particular platform.


1 Answers

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.

like image 179
Sergey Avatar answered Sep 18 '22 05:09

Sergey