English Български

Install Qt 5 on Ubuntu

Introduction

This is a tutorial for installation of Qt 5.0.2 to Ubuntu 12.10.

Installation Guide

  • Download

Visit Qt downloads page an download a 32-bit or 64-bit Linux installation [qt-project.org] depending your version of Ubuntu. The installation file can be also downloaded through the command line using wget.

Example:

  1. wget http://download.qt-project.org/official_releases/qt/5.0/5.0.2/qt-linux-opensource-5.0.2-x86-offline.run

  • Install

Adjust permission, run the installer and follow the instruction to complete the installation.

  1. chmod +x qt-linux-opensource-5.0.2-x86-offline.run
  2. ./qt-linux-opensource-5.0.2-x86-offline.run

  • Install g++

Open a terminal and execute the following command to install g++:

  1. sudo apt-get install build-essential

  • Configure a compiler

Launch Qt Creator. Go to Tools > Options. Click Build & Run and select tab Kit. Configure a compiler if it is not automatically detected.

  • Install OpenGL libraries

Execute the following command to install OpenGL libraries:

  1. sudo apt-get install mesa-common-dev

Troubleshooting

  • Qt Creator needs a compiler set up to build

Follow the instruction from the previous section to configure compiler for Qt Creator.

  • error: g++: Command not found

Solution:

  1. sudo apt-get install build-essential

  • error: GL/gl.h: No such file or directory

Solution:

  1. sudo apt-get install mesa-common-dev

Categories: