Qt Creator Installation - Linux

Our Linux installation instructions are short because we assume the Linux users to be relatively adept at installing and setting up software on their own machine. We do not provide detailed Linux install/setup help. If you are unable to get Qt Creator working on your Linux machine, please consider using another machine or working on a campus cluster computer.

1. Install necessary packages on your system

If you're running Ubuntu, Debian, Mint, or any other Debian derivative: Open a terminal and type the following command, then press Enter:

sudo apt-get -y install openjdk-8-jre build-essential

If you're running some other variant of Linux, figure out a way to make sure you have the following tools installed on your system. (For example, on Fedora / Red Hat systems, you may be able to use the yum package manager to install the above tools.)

  • make
  • gdb
  • gcc
  • g++

Please note that you do need to have Java JDK installed on your machine before proceeding. The above Ubuntu command installs Java JDK, but if you are not using that command, you can go to Oracle's Java JDK download page and click on the blue button link that says JDK download. Then you can download and install JDK on your system.

2. Download and Install Qt Creator

Go to the Qt Creator official download site to download this software. Near the middle of the page, there is a gray bar of links; in that bar, click the link named "Offline Installers". Now scroll down to "OS X Host", and choose Qt 5.7.0 for Linux 64-bit (715 MB). (The exact version may change over time, but make sure to choose the Linux 64-bit option.) Your download will begin. The file is very large, so it may take some time. It downloads a .run file to your machine. Execute this file to install Qt Creator on your system. You can choose all default settings and just press Next during the install.

And then go to the following Qt Creator download page and download the appropriate variant of Qt Creator for your Linux distribution. Under "Linux Host", you want the Qt for Linux, either 32-bit or 64-bit depending on your computer. (If you are not sure, try the 32-bit version.)

3. Try to compile/run a sample project

Let's make sure that all the parts are working together properly by building and running a sample Qt Creator project that uses the Stanford C++ libraries. The Stanford C++ libraries also interact with Java, so if this project runs properly for you, then you will be sure that your Qt Creator and Java JDK are both set up properly. Here's what to do:

  • Download the following project ZIP file to your computer.
  • Un-zip the file's contents to a directory of your choice. You should have a directory named simple-project with several files and folders inside.
  • Open the project. In Qt Creator, choose "File" → "Open File or Project..." or press Ctrl+O (or Command+O on Mac). Navigate to the simple-project folder and open the file simple-project.pro.
  • Qt Creator will ask you a few questions about how to set up the build process for this project. You can just accept the defaults and click "Configure Project".

    screenshot

  • Build it. Now you should be able to Build (Ctrl+B or Command+B) your project in Qt Creator. If it builds properly, your C++ compiler and the Stanford C++ libraries are at least compiling properly.
  • Run it. Now that it's built, you should be able to Run (Ctrl+R or Command+R) your simple-project. This is the part where Java is needed, so if your Java isn't properly installed, this is probably where it will fail. If it runs properly, you will see a window appear with a smiley face. Congratulations, you're done! Now your machine should work just fine for working on our homework assignments.

    screenshot

If you encounter any problems during your attempt to compile and run the sample project, check out our Qt Creator troubleshooting page. Otherwise, congratulations; you're done!

This document and its content are copyright © Marty Stepp and Victoria Kirst, 2016. All rights reserved. Any redistribution, reproduction, transmission, or storage of part or all of the contents in any form is prohibited without the authors' expressed written permission.