Why do I get qmake 4.8 in Qt5.0.1 ?
-
Hi,
I downloaded and installed Qt5.0.1 for linux64. However the qmake I got is version 4.8? It's causing problems likeerror: #error "This file was generated using the moc from 4.8.1. It"
error: #error "cannot be used with the include files from this version of Qt."Does anyone have the same problem? Where can I get qmake 5.0? Any help is appreciated.
-
When you type:
@
qmake
@the system uses a PATH to find an executable called "qmake" and it runs the first one it finds. In your case this is likely to be the system version of Qt... Qt 4.8. Type:
@
which qmake
@to see what I mean. Either put the Qt 5.0.1 bin directory in earlier in the path than whatever directory (probably /usr/bin) contains the Qt 4.8 version of qmake, or deliberately spell out the full location of the qmake tyou want to run:
@
/whatever/the/path/is/Qt5.0.1/bin/qmake
@ -
If you use Qt Creator, you can select a desired kit. No manual work is needed then.
-
I think the question you ask does not match the error message you post.
The error indicates you have a header file that moc from 4.8 generated that you try to compile.
You need to make sure all the moc files are regenerated. Try a 'make clean'
-
Otherwise through away the entire "debug and release" directories. Then do a qmake build (this will as Thomas indicated) to regenerate all desired files.
That should do the trick. -
Thank you very much, guys. The problem is indeed as Chris suggested, that I have another qmake in /usr/bin, which is version 4.8. And when I call qmake, this qmake 4.8 generates the moc files.
4/6