Install Qt Creator on Linux


Below are basic instructions for installing Qt on Linux that may work for your system, however, we are unable to provide further Linux support. If you are unable to get Qt Creator working on your Linux system, please consider using another computer or working on a campus cluster computer.

1) Install prerequisites

If you're running Ubuntu, Debian, Mint, or any other Debian derivative, you can install the needed preqreuisites using the apt package manager. Issue the following commands below in your shell.

This command ensures your package manager is up-to-date:

$ sudo apt-get update && sudo apt-get upgrade

This command installs the tools and libraries needed for Qt (be sure to copy/paste the entire line, it is long!)

$ sudo apt-get -y install build-essential openssl libssl-dev libssl1.0 libgl1-mesa-dev libqt5x11extras5 '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev

If you're running some other variant of Linux, figure out a way to install the tools make, g++, and gdb. (For example, on Fedora / Red Hat systems, you may be able to use the yum package manager.)

2) Download and run the Qt installer

If you have previously installed Qt Creator, you must first uninstall that one before re-installing the latest. To uninstall, find the Qt Maintenance Tool application and run it. On the first panel, select Uninstall only to proceed with uninstall. Now continue below to download and install the latest Qt version.

Download the Qt installer from its official download site at https://www.qt.io/download-qt-installer. The site should detect that your computer is running Linux and automatically download the correct installer to your ~/Downloads folder.

The downloaded installer is named something like qt-unified-linux-x64-version-online.run and is likely located in your ~/Downloads directory. Use chmod +x qt*.run to make the file executable, then run it by typing ./qt*.run.

The Qt installer will walk you through a set of steps. For most steps, you can use the default settings and simply click "Next" or "Agree" to move on, with the following exceptions:

  • At the Welcome step, sign up (or sign in) for your own Qt Account.
    • Enter your @stanford.edu email and verify your account via email.
    • When setting up your account, you do not have to enter a phone number or city.
    • Register as an individual user, not as part of a company/organization and not for commercial use.
  • At the Installation Folder step (see screenshot below):
    • Do not change the default name and location of the directory where Qt will be installed.
    • Select the option for "Qt 6.7 for desktop development" Qt libraries for GCC.

select desktop install

Wait until the installation process is finished (it can take a while), exit the installer when done.

Note: if your installer does not offer the option shown above, stop here. Your system is going to require a non-standard install. Contact the staff with your system information and we'll see if we can help. Depending on how esoteric your situation, this may not be successful. We recommend a backup plan to use a different computer or work on a campus cluster computer.

3) Install CS106-specific package

After installing Qt, you must install the CS106-specific package and do a complete build and run cycle to confirm all is working properly.

Download CS106 package and extract

  • Download this archive file: 📦 CS106.zip
  • Un-zip the download contents (on a Windows computer, click "Extract all") to a location of your choice. You should have a folder named CS106 with several files and folders inside.

Open and configure CS106 project

A Qt Creator project includes a file named with a .pro extension. Double-clicking the .pro file opens the project in Qt Creator.

  • Find the CS106.pro file and open it now.

  • When opening a project for the first time, Qt Creator will ask you to configure the project build kit. The "Configure Project" panel shows the list of available build kits (see screenshot below).
    • If your Qt Creator shows no kits are available, review the Qt install instructions. You can repeat the steps to re-install Qt if you missed selecting the correct option.
  • Check the box for the Qt desktop kit you installed (Qt 6.7.x for your desktop) and click the "Configure Project" button.

    Qt configure project dialog

Build the program

C++ code must be compiled or built before it is run; this means converting the source code into executable binary code.

  • Click the Build icon hammer icon in the lower-left of the Qt Creator window.
  • Watch the build progress meter build progress meter in the lower-right. The first time you build a project, it can take a minute or more to compile the library code. When the bar turns green, it indicates the program successfully built.

Run the program

Now that the program is built, you are ready to run it.

  • Click the Play/Run icon run icon in lower-left of window.
  • The welcome program will prompt you to enter your name and then will show a graphics window with the Stanford logo and confirmation of your library install (should be version 2024.1). Click the "Play sound clip" for a greeting from LSJUMB.

    screenshot of welcome program

✔️ Congratulations, your installation is good to go! You may now discard the CS106 project, you will not need it again.

4) Configure settings (optional)

For a better experience, we suggest changing some of the default settings, see our recommended configuration settings.