PDA

View Full Version : Setting QT Creator to use Visual Studio C++ compiler



Puchatek
8th March 2012, 10:18
Hello

I want to make an application based on Qt and preferably write it in Qt Creator. The default setting for build in my version of Qt Creator is to use mingw g++ compiler (I'm using Qt Creator 2.4.0 based on Qt 4.7.4 (32 bit), and running under Windows 7), however I need to use a dll for my project which was compiled for Visual Studio (and I verified it works with it). Thus I would like to switch the build options in Qt Creator so that it goes for VS C++ compiler rather than g++, but I fail miserably at it.

Here's what I tried doing: in Projects I created a new build configuration by copying the default 'Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug'. Then I tried changing the tool chain. It lists quite a few options, including 'Mingw as GCC for Windows targets', 'Symbian GCCE Toolchain', 'MinGW (x86 32bit)', and a number of 'Microsoft Visual C++ Compiler 10.0' tools for x86, amd64, and ia64. It would seem to me I should just choose here an appropriate Microsoft Visual C++ Compiler, however when I choose any of them and click Ok, or Apply followed by Ok, the Options window disappears as if accepting my choice, but the tool never gets changed. This can be confirmed both by opening it again and checking that 'Mingw as GCC for Windows targets' is still selected, and by looking over compiler output after build, which clearly invokes g++.

Anyone knows what I might be doing wrong? Why I can't change the toolchain to something that would let mu use dlls compiled for Visual Studio? Btw, I have Visual Studio 2010 installed, so I would guess correct compilers are there on the disk.

A perhaps relevant point - in all 'Microsoft Visual C++ Compiler 10.0 *' tools options there's no debugger. I can add it manually, but I wouldn't know what to add and where to look for it, I have no experience here.

Any pointers or references would be greatly appreciated.

Le_B
2nd April 2012, 17:13
you need to use a version of qt build with visual studio
qt creator will use the compiler used to build the qt version you specified