84

I want to build a Qt5 example on my desktop machine. I installed qt5-default and qtdeclarative5-dev, but I'm still getting this error:

Project ERROR: Unknown module(s) in QT: quick qml

Which package should be installed for compiling? In the Qt4 times it was simply libqt4-dev

5 Answers 5

91

List of all Qt5 developement packages, available on Ubuntu.

Qt module           dev package                         lib package
-------------------------------------------------------------------------
bluetooth           qtconnectivity5-dev                 libqt5bluetooth5
concurrent          qtbase5-dev                         libqt5concurrent5
connectivity        qtmobility-dev                      libqtconnectivity1
contacts            qtmobility-dev                      libqt5contacts5
core                qtbase5-dev                         libqt5core5a
dbus                qtbase5-dev                         libqt5dbus5
designer            qttools5-dev                        libqt5designer5
designercomponents  qttools5-dev                        libqt5designercomponents5
feedback            qtmobility-dev                      libqt5feedback5
gallery             qtmobility-dev                      libqtgallery1
gui                 qtbase5-dev                         libqt5gui5
help                qttools5-dev                        libqt5help5
location            qtmobility-dev                      libqt5location5
multimedia          qtmultimedia5-dev                   libqt5multimedia5
multimediakit       qtmobility-dev                      libqtmultimediakit1
network             qtbase5-dev                         libqt5network5
networkauth         libqt5networkauth5-dev              libqt5networkauth5
nfc                 qtconnectivity5-dev                 libqt5nfc5
opengl              libqt5opengl5-dev                   libqt5opengl5
organizer           qtmobility-dev                      libqt5organizer5
positioning         qtpositioning5-dev                  libqt5positioning5
printsupport        qtbase5-dev                         libqt5printsupport5
publishsubscribe    qtmobility-dev                      libqt5publishsubscribe5
qml                 qtdeclarative5-dev                  libqt5qml5
quick               qtdeclarative5-dev                  libqt5quick5
quickparticles      qtdeclarative5-dev                  libqt5quickparticles5
quicktest           qtdeclarative5-dev                  libqt5quicktest5
quickwidgets        qtdeclarative5-dev                  libqt5quickwidgets5
script              qtscript5-dev                       libqt5script5
scripttools         qtscript5-dev                       libqt5scripttools5
sensors             qtmobility-dev, libqt5sensors5-dev  libqt5sensors5
serialport          libqt5serialport5-dev               libqt5serialport5
serviceframework    qtmobility-dev                      libqt5serviceframework5
sql                 qtbase5-dev                         libqt5sql5
svg                 libqt5svg5-dev                      libqt5svg5
systeminfo          qtmobility-dev                      libqt5systeminfo5
test                qtbase5-dev                         libqt5test5
uitools             qttools5-dev                        ?
versit              qtmobility-dev                      libqtversit1
webchannel          ?                                   ?
webkit              libqt5webkit5-dev                   libqt5webkit5
websockets          libqt5websockets5-dev               libqt5websockets5
widgets             qtbase5-dev                         libqt5widgets5
x11extras           libqt5x11extras5-dev                libqt5x11extras5
xml                 qtbase5-dev                         libqt5xml5
xmlpatterns         libqt5xmlpatterns5-dev              libqt5xmlpatterns5

5
  • 3
    This is really helpful to figure out what to install when a cmake build gives something like /usr/bin/ld: cannot find -lQt5::Help. That kind of failure mode seems to be typical for cmake. Jul 11, 2016 at 20:58
  • This is very useful!
    – Atif
    Jul 22, 2016 at 20:13
  • 1
    Is there a simple way to install all of these *-dev packages at once?
    – Anonymous
    Mar 16, 2017 at 8:51
  • You can try something like apt-get install qt5*-dev
    – Hyndrix
    Jul 11, 2017 at 9:10
  • A piece of advice. Try and avoid the use of * with any aptitude commands! My friend had to restart his computer because apt remove wine* deleted all packages containing the substring win in it. Be extremely careful with this. Sep 19, 2017 at 12:45
78

You need to install

qtdeclarative5-dev
3
  • It's already installed, version 5.2.1-8build1
    – marmistrz
    Aug 8, 2014 at 9:58
  • 4
    what about qtdeclarative5-dev?
    – AlexGreg
    Aug 8, 2014 at 10:02
  • It's definitely qtdeclarative5-dev. Can you edit the answer body and add it, please?
    – int_ua
    Oct 11, 2014 at 13:47
44

The answer to the title is:

sudo apt-get install qtbase5-dev

For your specific problem, the answers above are correct, though.

0
6

You can obtain the list of all Qt development packages to choose from with this command:

apt list "libqt5*-dev" "qt*-dev"

It will show the packages available in your current Ubuntu repositories based on the package names for development packages that can be observed in the answer by @gossen. For details about the command and similar commands, see here.

1
  • 1
    I would say this is slightly better: apt list "libqt5*-dev" "qt*5-dev"
    – DimanNe
    Nov 1, 2021 at 9:42
4
sudo apt-get install qtdeclarative5-dev qml-module-qtquick-controls

Validate the installation, through::

qtchooser -print-env

Output might resemble as follows (based on package available for your Ubuntu version):

QT_SELECT="default"
QTTOOLDIR="/usr/lib/x86_64-linux-gnu/qt5/bin"
QTLIBDIR="/usr/lib/x86_64-linux-gnu"

Reference here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.