I am trying to install Jom (http://wiki.qt.io/Jom) for C++. When I type in qmake -r in cmd, I get the error Project MESSAGE: Cannot build jom with Qt version 4.8.7.
Project ERROR: Use at least Qt 5.2.0.
. This is because I have PyQt version 4.8.7 and Qt version 5.8.0 both installed. When building Jom, Jom searches for in the wrong Qt folder. How can I fix this?
If you have multiple version of Qt installed, you also have multiple version of qmake. You can check which qmake you are running by using where qmake
on Windows, it will output a list of qmake executable available in your path, the first one in the list will be the one executed when running qmake
.
For instance:
C:\>where qmake
C:\Qt\5.8\msvc2015\bin\qmake.exe
C:\Qt\5.6\msvc2015\bin\qmake.exe
If the first one, is not the one you want, you can run it by using its complete path:
C:\>C:\Qt\5.6\msvc2015\bin\qmake.exe -version
QMake version 3.0
Using Qt version 5.6.2 in C:/Qt/5.6/msvc2015/lib
If the qmake and Qt version you want is not in your PATH, you can use the scripts provided by Qt to setup a valid environment. These are available in the Start menu as Qt 5.8 64-bit for Desktop (MSVC 2015)
(change according to your installation), or you can use them directly by executing qtenv2.bat
(e.g C:\Qt\5.8\msvc2015\bin\qtenv2.bat
).
If you are using MinGW you are all set, but if you are using MSVC you need also to run vcvarsall.bat
, which can be found in your Visual installation folder.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments