Here are instructions to running Qt 5.1.0 on Ubuntu 12.04 LTS. Please note that I got it working on a virtual machine, here are the details:
- VMware Player 5.0.2 build-1031769
- New install of Ubuntu using image “ubuntu-12.04.2-desktop-amd64.iso”
Get Ubuntu running on the VM, I’m not going go through all that. Once Ubuntu is ready, install the OpenGL development libraries:
sudo apt-get install libgl1-mesa-swx11-dev (see update below)
sudo apt-get install libgl1-mesa-dev
NOTE: I used the mesa libraries because I didn’t have the drivers for my graphics card.
Download Qt from their website. I used this “qt-linux-opensource-5.1.0-x86_64-offline.run”.
chmod a+x qt-linux-opensource-5.1.0-x86_64-offline.run
NOTE: I installed using sudo so that I can install to /opt/ so that everyone has access. For some reason when I installed it to /opt/, the examples directory has no permissions at all. I don’t know why it does that but here’s how you fix it:
sudo chmod -R a+rwx /opt/Qt5.1.0/5.1.0/gcc_64/examples
Now you can run the examples. Run the examples from their original directory (in my case it is /opt/Qt5.1.0/5.1.0/gcc_64/examples) because some of the examples have code in folders outside their source folder.
I have tried the following examples and they work:
- Analog Clock
- OpenGL Window*
- Same Game*
Hang on, hang on! I’ll explain in the next section 🙂 See update below.
Yay! I finally got the OpenGL applications working (I’ve struggling for a day to get it working, it turned out i was using the wrong OpenGL mesa libraries).
However, it appears that the color black is displayed transparently. WTF you ask?? Don’t look at me 😛
Does anyone know WTF is going here??
Problem fixed!! Yay!!
Use the “libgl1-mesa-dev” package and all is ok. This is because Ubuntu by default installed “libgl1-mesa-dri-lts-quantal” and the matching dev package is “libgl1-mesa-dev” (see http://packages.ubuntu.com/precise/libdevel/).