Saturday, September 24, 2011

"WARNING: Can't find the Qt version that's associated with this project."

Updated in Sept 2013 for Qt5.

I don't know why. I am always haunted by this whenever I use a new Qt version:
"WARNING: Can't find the Qt version that's associated with this project. Defaulting to <some Qt version> instead. Please assign a valid Qt version to this project in the Qt project settings."

It happens when you are trying to build and you get it in the build Output window. Trying to change the version using Qt Visual Studio Add-in doesn't help.

My workaround:
  1. Open your project file in a text editor. The project file is the one with "vcxproj" extension, eg: AwfulProject.vcxproj
  2. Look for one of these:
    • For Qt4, QtVersion_x0020_Win32
    • For Qt5, Qt5Version_x0020_Win32
  3. Change it to the Qt version you desire, for example:
    • For Qt4, QtVersion_x0020_Win32="4.7.4"
    • For Qt5, Qt5Version_x0020_Win32="5.1.1"
  4. Save the file.
  5. Reopen the project in Visual Studio.
  6. Remember to change other Qt projects that this project depends on.

No comments:

Post a Comment