Qt Creator Installation - Linux

While we provide basic Linux installation instructions below, 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.

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 build-essential openssl libssl-dev libssl1.0

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 download the Linux version of JDK. Then you can download and install JDK on your system.

Depending on your Linux setup, you may need to take additional steps if you see errors in the outlined process. For instance, the following articles may be helpful:

  • https://askubuntu.com/questions/18747/how-do-i-install-run-files
  • https://stackoverflow.com/questions/30321980/usr-bin-ld-cannot-find-lgl

Download and Install Qt Creator

  1. Download the installer:Go to the Qt Creator official download site to download this software. Choose Recommended download: Qt Online Installer for Linux and click the Download button at the bottom of the page. Your download will begin.
  2. Launch the installer:Once you have downloaded the Qt Creator .run installer, execute this file to install Qt Creator on your system.
  3. For most of the screens, you can just click "Next" to move to the next option, with the following exceptions.
    • At the "Registration" screen, you can press "Skip" to skip the registration step.
    • (IMPORTANT) Install the gcc Component: At the next screen, labeled "Select Components", expand the Qt triangle, then expand the "Qt 5.11.2" triangle, and then click the checkbox labeled, "Desktop gcc". See the screenshot below. This is absolutely crucial; if you forget to do this, your computer will not be able to compile and run C++ programs.

      screenshot

    • For all subsequent screens, you can just press "Next" or "Agree" or "Install" to finish the installation.
    • When the installation finishes, click "Done" to launch Qt Creator.

When the installation finishes, click "Finish" to launch Qt Creator.

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 sample-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 sample-project folder and open the file sample-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. The first time you build a given project, it will take a while (30-60 sec or more) to compile all of the various libraries. You can click the bottom "4 Compile Output" tab if you want to see the progress as it is compiling. (Recommended: In Qt Creator, click Tools → Options → Build & Run, and check the box labeled "Open Compile Output pane when building" to always see this output during compilation.)
  • Run it. Now that it's built, you should be able to Run (Ctrl+R or Command+R) your sample-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 Julie Zelenski, 2019. 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.