You are not logged in.

Dear visitor, welcome to If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.


Thursday, July 2nd 2009, 8:29am

Installing QT 4.5.2 on Windows

I have downloaded the Windows LGPL installer (…rce-2009.03.exe) and run the executable on Windows XP SP3. I set up the QTDIR environment variable to "C\Qt\2009.03", and added "%QTDIR%\bin" and "%QTDIR%\qt\bin" to the PATH environment variable. I have Visual Studio 2005 installed, so I then installed the Qt VS plug in (, and set up the QMAKESPEC environment variable to "win32-msvc2005".

QtCreator runs and auto-detects the Qt path, however, when I start Visual Studio from any user, I get the following error:

"Qt Visual Studio Add-In

The following error occured:
These Qt version are inaccessible:
2009.03 in C:\Qt\2009.03
Make sure you have read access to all files in your Qt directories"

Both my Administrator and users in a new group called "Developers" have full control of the Qt folder, but both have the same problem.

Can anyone tell me what I need to do to fix this?

This post has been edited 2 times, last edit by "aFiveH" (Jul 2nd 2009, 8:35am)


Thursday, July 2nd 2009, 8:42am

More information that may be relevant.

QtCreator successfully creates a project, builds it using the mingw compiler (that comes with the package) and runs the built application. However, when I try and create a Qt project using Visual Studio (for example, a console or GUI project), I get the following error:

"Qt Visual Studio Add-In

The following error occured:
The file C:\Qt\2009.03\.qmake.cache doesn't exist.
(at Trolltech.Qt4VS2005.QtProjectLib.VersionInformation..ctor(String qtDirIn)
at Trolltech.Qt4VS2005.QtProjectEngine.QtProjectEngine.CreateProject(DTE app, String proName, String slnName, Boolean exclusive, FakeFilter[] filters, String qtVersion, String platformName))"

I have searched the QTDIR and the reported file does not exist.


Thursday, July 2nd 2009, 10:12am

After hunting around again, here is the list of instructions required to build Qt applications using Visual Studio:

1. Once you have installed Qt from the EXE, make a copy of the Qt directory called "2009.03-msvc"

2. Set your QTDIR environment variable to the "2009.03-msvc\qt" folder.

3. Edit your PATH environment variable to include "%QTDIR%\bin".

4. Open a command window

NOTE: The following commands should all be performed using the command line window you just opened.

5. Run the "VCVARS32.BAT" script from your Visual Studio installation's "VC\bin" folder

6. Before you can rebuild the Qt libraries, you must configure the Qt source for use with Visual studio by running "configure -platform win32-msvc2005" (replacing "win32-msvc2005"

with the makespec for your version of Visual Studio - see the "%QTDIR%\qt\mkspecs" folder for available makespecs)

(There is a whole host of other flags identified when you do "configure -help" which can also be used to suppress the building of certain libraries, for example;
-no-sql-sqlite -no-qt3support -no-opengl -no-libtiff -no-dbus -no-phonon -no-phonon-backend -no-webkit" )

NOTE - this will take quite a few minutes to complete (depending upon your machine specification).

7. Now that the Qt source is configured, you must build the Qt libraries by running "nmake"

NOTE - this will take quite a few minutes to complete (depending upon your machine specification).

8. Install the Qt plugin for Visual Studio

9. Open Visual Studio and select the "Qt Options" sub menu item from the "Qt" menu item. Ensure that the "Qt Versions" list only has the path to the "%QTDIR%\qt" folder. (This

should also set the Default Qt/Win version).

(Much of this information was found on the DCSoft website:…ntegration.aspx)