PDA

View Full Version : installing and configuring Qt on a laptop running Ubuntu 12.04



modoMojo
19th June 2012, 10:34
Hi, I'm trying to get Qt working on my Ubuntu 12.04 laptop. I installed via the run file for the 'online' installation from the nokia.qt site. Yet when I tried to run qmake, it wasn't installed. So I installed qmake via synaptic and I'm able to produce makefiles. The problem is that during compilation the compiler fails to find header files like QDebug. It also returns a linking error as it is unable to find QtGui or QtCore. I think that this may have resulted from the installation process. Is there something I can do to reconfigure Qt or some other way to install it so that 'make' can find all the header files and linked libraries? Much in need of help.

If I need to reinstall Qt (say via the x11 method I have just realised is for *nix) how do I uninstall Qt? I can uninstall qmake via synaptic, but the rest?

wysota
19th June 2012, 10:37
Installing Qt through the online installer will not add appropriate paths to your PATH. Thus you either need to do that yourself somewhere or use apt-get (or synaptic) to install Qt from system repositories instead of using the online installer. Alternatively you can use the full path to qmake while calling it but this is cumbersome in the long run.

modoMojo
19th June 2012, 11:03
Ok, thanks for your quick response. I'm relatively new at this, so how do I add appropriate paths to my PATH?

Also, in case that doesn't work what packages do I need to install from the system repositories to install Qt?

wysota
19th June 2012, 11:19
I'm relatively new at this, so how do I add appropriate paths to my PATH?
The easiest way is to add

export PATH=/path/to/where/you/installed/qt/bin/:$PATH
to ~/.bashrc and relogin.


Also, in case that doesn't work what packages do I need to install from the system repositories to install Qt?

libqt4-dev and qt4-dev-tools. Optionally also qtcreator if you want to use QtCreator. qt4-doc and qtcreator-doc might also come in handy.

modoMojo
19th June 2012, 23:57
Alright!! I deleted the old QtSDK installation and installed via synaptic the packages you recommended and now make works for Qt files! Thanks, Wysota!

BTW whereabouts can I find out about what packages to install for particular language developer environments? Or is it just a case of ask around?

wysota
20th June 2012, 09:29
Ask around or try yourself. I usually do:

apt-cache search <name related to what I want to do>

and then continue based on the result I get.