PDA

View Full Version : Update Qt library/creator; using old projects? (Mac)



badmilk101
2nd July 2013, 23:34
Note: I am still very much a beginner when it comes to programming and using programming tools. My OS is Mac OS X 10.8.4.

For the past couple years, I had used Qt Creator 1.?.? based on the Qt 4.6.? library to create some very basic programs (think "Hello World", Tic-Tac-Toe", etc.). [question marks are there because I don't recall the versions exactly].

I recently found the need to use a more recent version of the Qt library (version 4.8). I downloaded and installed Qt libraries 4.8.5 for Mac (but not the debug libraries). I then downloaded Qt Creator 2.7.1 for Mac and dragged it to my Applications folder, which replaced [deleted] my previous version of Qt Creator.

I have tried various settings for "configure project" for my old projects, but I can't get any of them to compile. They all give errors referencing a "version 4.6", which seems bad. Here is the type of thing I get...

17:28:09: Starting: "/usr/bin/qmake" /Users/my_username/Qt_stuff/NNNcube2/NNNcube2.pro -r CONFIG+=x86_64 -spec /usr/local/Qt4.6/mkspecs/macx-g++
Failure to read QMAKESPEC conf file /usr/local/Qt4.6/mkspecs/macx-g++/qmake.conf.
Error processing project file: /Users/my_username/Qt_stuff/NNNcube2/NNNcube2.pro
17:28:09: The process "/usr/bin/qmake" exited with code 3.
Error while building/deploying project NNNcube2 (kit: Qt 4.8.4 in PATH (System))
When executing step 'qmake'

1. Did I update Qt Creator & Qt library incorrectly? If so, what should I have done?

2. Am I naive/ignorant to think that I should be able to update from 4.6 to 4.8 without too many issues? Should I have instead tried to keep my old instance of Qt Creator (w/4.6 lib.) and created a new instance of Qt creator (w/4.8 lib.)?

3. What should I do now to remedy the situation (to be able to use my old projects)? None are terribly important, but it would be nice to have them.

Thanks!

ChrisW67
3rd July 2013, 02:05
Your Qt Creator is still running a Qt 4.6 version of qmake (from /usr/local/bin) but Qt 4.6 is at least partly missing. You should be running qmake from the Qt 4.8 install. Have a look at the Qt Creator Tools Options, Build & Run to configure a Kit that uses the new Qt, and use that to build your program.

Make sure you do a complete clean build using the new tool chain.

badmilk101
3rd July 2013, 04:27
Thanks for the reply, Chris.

Qt4.6 is missing from /usr/local/, which is what the error is telling me, I think. Qt4.8 *is* in /usr/local/, so I'm guessing it removed Qt4.6 when I installed the new library. (Interestingly, Qt4.5 is also there ... hmm).

I didn't notice this before, but under Build & Run > Kits, with Qt 4.8.4 chosen, the default path listed for "Qt mkspec:" was /usr/local/Qt4.6/mkspecs/macx-g++

I changed this path by replacing the "4.6" with "4.8", but it didn't seem to do anything; here is what I get when I try to make clean:

21:50:32: Starting: "/usr/bin/make" clean
make: *** No rule to make target `/usr/local/Qt4.6/mkspecs/macx-g++/qmake.conf', needed by `Makefile'. Stop.
21:50:32: The process "/usr/bin/make" exited with code 2.

I've looked around in the Build & run preferences, but I can't seem to find any other mention of version 4.6 to correct.

Added after 26 minutes:

Update: I think I figured it out.

I was looking at "Build & Run > Kits" found via *preferences*. This is a good thing, I think, because I probably needed to change what I changed.

However, apparently I also needed to update paths found in the expandable "details" sections found in Build & Run: Build Settings after clicking on the Projects icon (located on the left in my Mac version of Qt Creator 2.7.1).

Thanks for helping to point me in the right direction!