Tuesday, September 22, 2009

Compiling Nokia QT on Snow Leopard

Well, I've been trying to install ParaView for a while on Snow Leopard, and I was unable to do so since the installer for the current version of the Qt SDK (4.5.2) is broken. However, not all hope is lost. The installer still contains everything necessary to get Qt up and running. Here's what to do:

First, open the package and mount it by double-clicking it. Cancel the installer that pops out, and go into the Finder, and open the Qt SDK image. You will see a "QtSDK.mpkg" icon, like shown below:
Right-click on it to reveal a context menu, and select "Show Package Contents", which will open a new window with the innards of the installer:
Not very exciting, but it will suffice. Go into Contents/Packages and you will see the motherlode:

Now, each .pkg file contains its own installer, which you can activate by double-clicking on each of the icons. I installed the libraries, debuglibraries and headers packages first, then everything else. Now, if the installation was successful, we should be able to go into /Developer/Applications/Qt and see if the qtdemo program exists. In my installation, it did, and when I executed it, the following screen came up:

Success!

I haven't tried playing around with it very much, but the gradient and vector deformation demos do work. Now I just have to try getting ParaView to work, but that'll be later...

~~~~

14 comments:

IvanDM said...

Compiling?

Reid said...

No code was compiled in the writing of this post.

:-)

Unknown said...

compiling still didnt work for me... allways the same error with "qmake" and this stuff... i also post such a manual but yet im using qt on an vmware with win xp...

Reid said...

@Moritz what kind of errors did you get out of qmake? Was your PATH/path set up correctly?

Unknown said...
This comment has been removed by the author.
Unknown said...

yeah, i set up all but still errors that qt doesnt find qmake... maybe i did something wrong, could you describe how you set up the paths?

and after it founds qmake and i want to compile, it shows me an error "string.h: No such file or directory..." but the file exists there.

Titoxd said...

Yeah, I sort of realized it was the wrong word, AFTER I click the Publish button. :P It's more disassembling the installer more than compiling from scratch. Moritz, which OS are you using in the VM?

Unknown said...

im using windows xp sp3 on vmware fusion, thats working perfect. but on snow leopard i allways get errors... actually it didnt find files like i wrote in the post before :(

Titoxd said...

Moritz, you may try the steps here to view and set the PATH variable for your console (bash is the default on OS X). Also, double-check whether you have the new version of Xcode installed (I've read that the previous versions' compilers are not compatible with Snow Leopard, so that might also cause trouble). Also, did you run ./configure before using make?

Titoxd said...

There's also a step-by-step guide from Trolltech / Nokia for Mac OS X installation online as well.

Unknown said...

I have the following path variables. Does something missing?
/usr/bin
/bin
/usr/sbin
/sbin
/Developer/Tools
/usr/local/Qt4.5
/usr/local/bin

when i try "qmake" or "make" in the terminal it exists. only when i compile a qt (hello world) project it doesnt find the headers...

thx for all your help

Titoxd said...

Hmm... at this point, it seems like the makefiles are messed up, and may have to edit them by hand (a dark art I have not mastered yet) :(

Unknown said...

but when i create a completly new project and want to compile this could the makefiles also be the problem?

Titoxd said...

If you are able to compile something completely unrelated to Qt, and it succeeds, then your setup is probably ok. Are you able to do that? Also, if you type "qmake -v", does it return anything to the screen?

Also, if you were able to get the Qt source to compile, but cannot use it when trying to compile other projects that depend on Qt, that's a different issue (the compiler can't link to your header files if it can't find them)...