Configure qmake to use MSVC toolchain



  • Hi guys.
    I'm using QtCreator 2.2.1 and I need to switch to MSVC from MinGW. I have Qt SDK 4.7.4 which comes with Qt binaries compiled with MSVC. Currently my efforts didn't bring any result. QtCreator just doesn't want to set the toolchain :(
    I have specified the correct qmake path for build config, I have downloaded debugging tools for windows, I have created WINSCW toolchain and specified pathes but I can't just set the toolchain :(
    Am I doing something wrong?
    Anyone knows how to setup MSVC with QtCreator?

    I appreciate your help.
    Thanks

    P.S. I have installed VS 2010 on my machine.



  • Make sure the currently Qt version is set to the MSVC build. Creator automatically detects the toolchain based on the qt version chosen.



  • Thanks Franzk, I already changed to MSVC build, but it can't detect the toolchain. I even don't have an option to set it manually. :(



  • Try the projects->build settings (left hand side of the screen) and see if it gives you some more information.



  • Franzk, I already tried that, no matter if I change build config or select MSVC from toolchain list, the toolchain is not set. http://dl.dropbox.com/u/3055964/Untitled.gif <-- here's the screen. When I click ok, it does nothing and I still can't build the project



  • Ok, I saw somewhere that there is a way to export qt .pro file to VS project, if my memory isn't lying, maybe this is an option for me?


  • Moderators

    [quote author="Davita" date="1315294563"]Ok, I saw somewhere that there is a way to export qt .pro file to VS project, if my memory isn't lying, maybe this is an option for me?[/quote]
    If you have a regular, licensed version of msvc, you can install vsaddin. There is an option to open .pro project files in msvc.

    Unfortunately, if you have only msvc express, you cannot install vsaddin, because the express version does not allow add-ins :-(



  • No, I have a licensed version of MSVC pro.
    I wanted to avoid the addin, isn't there any other way?


  • Moderators

    Are you using MSVC 2008? I am a bit shaky on the compiler version numbers (the numbers we show in the name of the autodetected tool chains) and the Visual studio versions they are shipped with. Hover the tool chain and you should see the ABI it supports. It needs to match the ABI of the Qt version (visible in the tool tip of the Qt version).

    Basically the different MSVC versions are incompatible with each other... You will need to make sure that the Qt used was build with the same version MSVC compiler. Note that MSVC 2010 is not supported since it has issues building Qt in 64bit mode, resulting in random crashes when running any application. You need a hotfix for the compiler to make this work (SP1 is not enough IIRC).


  • Moderators

    [quote author="Davita" date="1315295512"]No, I have a licensed version of MSVC pro.
    I wanted to avoid the addin, isn't there any other way?[/quote]

    Since you have a licensed version, I would recommend to use vsaddin. Apparently, there was another suite of tools before. A couple of years back I had downloaded a set called vsintegration. While trying to install at that time vsaddin and vsintergation in parallel the system was not happy about this. I am not sure, but I assume that vsintegration was more of loose set of tools or maybe the predecessor of vsaddin. I just "limited" myself to vsaddin.
    I am using it with vs2005 and it is working. I have used the feature to import .pro files a couple of times (I believe with some of the examples) and I did not run into problems.



  • Thanks guys, I'll try VS adin, it should be much easier and let you know the results.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.