I had some really weird issues while setting up Visual studio 2010 with Qt 4.7. The most important thing (that I stupidly didn’t realize) was the fact that you CANNOT use the VS2008 compiled libraries and dll’s (available on the Qt webpage) if you don’t have VS2008 installed. The reason is because the Qt SDK you download is a debug build which is dependant on the VC9.0 DebugCRT, meaning it needs the Visual C++ 2008 Debug Runtime installed, which is NOT available as a redistributable installer. The only way to install the DebugCRT is to install the entirety of Visual Studio 2008.

The reason this was complicated to figure out was because most of the computers I installed it on had VS2008 allready installed on it, so only a couple computers wouldn’t compile properly. It also wasn’t helped by the fact that the errors given by it were pretty esoteric. There also were some errors caused by different paths being set wrong, a list of some of there errors is just below.

  • The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.
  • This application has failed to start because the application configuration is incorrect. Review the manifest file for possible errors. Reinstalling the application may fix this problem. For more details, please see the application event log.
  • Error MSB6006: “cmd.exe” exited with code 3.    C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets

To solve these problems and get Qt working properly with VS2010 you have to compile QT from source, which means you’ll have to download the 4.7.1 source sdk. You’ll also need to have the Visual Studio Qt Add-in installed.

I wrote a quick tutorial on how to compile it from source using Visual Studio 2010:

After you have compiled qt, put the folder in your C:\Qt directory.

Then open up a Visual Studio project, and in the Qt menu select the “Qt Options” menu item.

When the window below opens up, add the newly compiled version and select it as the default Qt version (in the bottom dropdown).

Afterwards, right click the project(s) which are using Qt and select the Qt Project Settings option.

A window should pop up showing the Qt details for that specific project. You then must choose the same version you just added as the project Qt version. I had some issues with the project not having the correct version set and it ended up causing the same errors.

Finally, you need to make sure the correct Qt version is in the system environment Path variable. So open the start menu, and type in the search bar “environment” and click the “Edit the system environment variables” item that will appear after a few seconds (note, this is only for windows 7, for windows XP you’ll have to find this option in the control panel). After you click the option, click the “Environment Variables…” button at the bottom.

Make sure that the path has a reference to the Qt bin directory of your newly compiled Qt build. It must be the bin directory, and nothing else.

After all that is done, I’d restart Visual Studio, reload your project, and it should be good to go.

« »