[solved] 5.1.1 install building with 4.8?
-
I just installed 5.1.1 on my mac and recompiled one of my programs. I was pleasantly surprised when everything compiled without errors. However, when I ran macdeployqt, I noticed that it installed version 4 of the frameworks. At first, I thought something was wrong with macdeployqt. However, when I ran otool on the binary, it says it is linked with 4.8.2! I checked the settings in Qt Creator, and it is definitely set to use 5.1.1. What gives? How can I get Qt Creator to build with the new version?
EDIT: It appears that the 5.1.1 installation didn't copy qmake to /usr/bin. This shouldn't be a problem though, shouldn't it look for qmake in the location given by the Qt version that I select? I've set QTDIR to the 5.1.1 location (the installer didn't do that either) I've selected it in the build settings and in the kit selection tab. I've selected it everywhere I know to, but when I removed qmake (for 4.8) from /usr/bin Creator complained about not being able to find it. Nothing I do will make it use the on in the 5.1.1 install location. I can copy that qmake to /usr/bin, but I have no idea what other files may need to be installed or where. Is there some secondary installer I need to run? I'm pretty sure when I upgraded to 4.8 from 4.6 it did it all for me.
-
Hi and welcome to devnet,
The latest installers (unlike the old SDK) don't install Qt in the system directories. This allows to have several versions of Qt installed at the same time without interfering with each other.
I would recommend that you remove this old Qt (unless you really need it)
By the way, what version of QtCreator are you using ?
-
Thanks for the reply. I'm using Qt Creator 2.8.1, which came with 5.1.1. I also have 2.5 installed, which is what I was using before. I installed Qt into /usr/local/Qt5.1.1 because I didn't want it in my home directory, but I don't guess that would mess up anything.
I'm not sure if I need the old Qt. I'd like to at least compile with 5.1.1 first to make sure that everything works. It seems that the opposite of what you are saying is true though, Its not letting me switch between Qt versions at all. "Qt in path" is an option in the various dialogs (what is the difference between build settings and kits? They both have you select a Qt version?) but when I select a different version, it doesn't seem to take. I'm afraid if I remove the old one I won't be able to build anything. Right now I'm behind on a deadline, so that would be disastrous. -
/usr/local is a standard directory for "local" installs. i.e. installing a Qt4 build by hand would end up in /usr/local/Trolltech/{bin,lib,mkspecs, etc..}. By system folder I meant /usr/bin.
Since you're in a hurry to validate Qt 5, you could build your project from the console using the full path to your Qt5 qmake.
-
Thanks. I did get that to work, it complained about QLabel not being found, but that is to be expected. It might take me a while to sort out all of the changes required (especially using the command line). But, when I removed qmake from /usr/bin, Qt Creator wouldn't do anything all, complaining that it couldn't find qmake. Selecting the 5.1.1 version didn't help. If I actually delete the old Qt installs, won't that problem still exist? Will a reinstall fix it after the old ones are gone? In the project settings, I changed my QTDIR to the path for 5.1.1, but that didn't help.
-
That one is easy, you need
@QT += widgets@for Qt 5
That's strange... Right now I can't really tell you where exactly the problem could lie (I don't use QTDIR) and generally build Qt myself.
One quick idea that comes to my mind... It might be that the new QtCreator tries to use the configuration file of your old QtCreator and that that somehow creates a problem... 2.5 is pretty old.
-
Yeah, I saw the bit about adding widgets, but I don't really want to fully convert the thing to Qt5 and then never be able to use Creator again. Is there a way to rebuild my configuration file?
-
You can check the ~/.config folder for QtCreator related configuration files/folder and move them somewhere safe.
-
Aha! Thanks! That appears to have worked. Although, I'm currently using the tool that I'm also trying to convert to Qt5 so I'm going to hold off on messing with it until I am done with it for the day. Thanks, again!
-
You're welcome !
If it's all working now, can you update the thread title prepending [solved] so other forum users may know a solution has been found :)