Qt5 development libraries for Debian

Abstract: Install qtbase5-dev on Debian to compile Qt5 C++ applications using apt-get, qmake, or CMake.

Created: 2026-10-01 by
Install the qtbase5-dev package via apt-get install qtbase5-dev to access core Qt5 headers and libraries on Debian. This single dependency pulls in the essential build tools, allowing you to compile basic C++ applications immediately without configuring complex external repositories or manual source builds.

Installing the Core Development Package

The most straightforward method to begin Qt5 development on Debian is using the system package manager. The Debian repository maintains a stable version of Qt5 that is sufficient for most standard application development tasks. To proceed, open your terminal and execute the installation command with superuser privileges.
sudo apt update
sudo apt install qtbase5-dev
This command installs the base development files required for compiling Qt5 applications. It includes the qmake build tool, which is the traditional way to configure and build Qt projects. While modern Qt development often prefers CMake, qmake remains fully supported and integrated into this package. If you encounter permission errors, ensure you are running the command with sudo. For users who prefer an integrated development environment, installing qtcreator alongside the dev libraries provides a complete GUI-based workflow.

Verifying the Installation

After installation, it is crucial to verify that the compiler can locate the Qt5 headers and libraries. You can test this by creating a minimal "Hello World" application. Create a file named main.cpp with the following content:
#include <QApplication>
#include <QPushButton>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QPushButton button("Hello Qt5");
    button.show();
    return app.exec();
}
Compile this file using g++ and link it against the Qt5 core and gui modules. The command should look like this:
g++ -o hello main.cpp $(pkg-config --cflags --libs Qt5Core Qt5Gui)
./hello
If the window appears correctly, your environment is configured properly. The pkg-config utility automatically resolves the correct include paths and library flags, preventing common linking errors. If compilation fails, check that the qtbase5-dev package was installed successfully and that pkg-config is available on your system.

Using qmake for Project Management

For larger projects, managing dependencies manually becomes inefficient. The qmake tool generates Makefiles based on a project specification file. Create a file named hello.pro with the following lines:
SOURCES = main.cpp
QT += core gui widgets
Then run the following commands in the same directory:
qmake
make
This approach handles linking and header inclusion automatically. The QT += line specifies which Qt modules your application requires. Common modules include core, gui, widgets, network, and sql. Adding these tags ensures that the necessary libraries are linked during the build process. This method is particularly useful when sharing project files across different operating systems, as qmake adapts to the host environment.

Alternative Build Systems

While qmake is the native build system for Qt, many developers prefer CMake for its flexibility and widespread adoption in the broader C++ community. Debian provides the cmake-qt module to support this workflow. Install it using:
sudo apt install cmake qtbase5-dev
Create a CMakeLists.txt file to define your project:
cmake_minimum_required(VERSION 3.0)
project(hello)

find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)

add_executable(hello main.cpp)
target_link_libraries(hello Qt5::Core Qt5::Gui Qt5::Widgets)
Run cmake . followed by make to build the project. This setup offers better control over compiler flags and integrates seamlessly with modern IDEs like CLion or VS Code. Choose the build system that best fits your team's standards and existing project infrastructure.

Managing Dependencies and Updates

Qt5 packages on Debian are updated regularly to fix security vulnerabilities and bugs. Regularly run sudo apt upgrade to keep your development libraries current. Be aware that major version upgrades may introduce breaking changes in API behavior. Always review the release notes provided by The Qt Company before upgrading in production environments. For specialized modules not included in qtbase5-dev, such as Qt Quick or Multimedia, install additional packages like qtdeclarative5-dev or qtmultimedia5-dev. Each module follows the naming convention qt5-dev. Check the Debian package tracker for a complete list of available Qt5 components.

Frequently Asked Questions

Can I use Qt6 instead of Qt5 on Debian?

Yes, Debian supports both Qt5 and Qt6 simultaneously. Install the qtbase6-dev package for Qt6, but be aware that APIs differ between versions. Migrating code from Qt5 to Qt6 requires significant refactoring due to API changes.

How do I install Qt Creator on Debian?

You can install Qt Creator directly from the Debian repositories using sudo apt install qtcreator. This provides a stable, community-supported version. For the latest features, consider downloading the official installer from the Qt website.

Why does my build fail with missing header errors?

Missing header errors usually indicate that the corresponding development package is not installed. Ensure you have installed qtbase5-dev and any other specific module packages required by your code. Verify that pkg-config or qmake is correctly identifying the installation path.

Is qmake still recommended for new projects?

While qmake remains fully supported, CMake is increasingly preferred for new cross-platform projects. CMake offers more granular control over build configurations and integrates better with modern CI/CD pipelines. However, qmake is simpler for quick prototypes and small projects.

How do I find all available Qt5 packages?

Use the command apt-cache search qt5 to list all available Qt5 related packages in the Debian repository. This helps identify optional modules like networking, SQL, or XML support. Filter the results to find development headers specifically by looking for packages ending in -dev.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More