Search code examples
c++qtubuntuubuntu-16.04kdevelop

KDevelop include QtGui not found


I'm trying to learn how to use KDevelop on my Ubuntu 16.04 to write C++ code, and I installed it by doing this

sudo apt-get update
sudo apt-get install kdevelop

but after it is done installing and I'm trying to make a new project, and the lines at the top that says

#include <QtGui/QApplication>

and

#include <QtGui/QLabel>
#include <QtGui/QMenu>
#include <QtGui/QMenuBar>
#include <QtGui/QAction>

are all returning errors saying that the included files are not found? And ask me to add a custom include path. I checked my KDevelop version on the terminal and it says I have Qt, or at least I think that's what it meant.

~$ kdevelop --version
Qt: 4.8.7
KDE Development Platform: 4.14.16
KDevelop: 4.7.3

But then when I run

~$dpkg --list libqt4-dev
~$dpkg --list libqt4-core
~$dpkg --list libqt4-gui

and it says none of them are installed. I'm so confused. Do I have the right Qt or not? How do I get KDevelop to find the correct Qt path? Should I maybe just install all the libqt4-whatever and try again?


Solution

  • Remember to distinguish between libraries that allow you to run a software and developer versions that allow to build new sotfware. Output of kdevelop --version states versions of the libraries which are used to run the application. In your system you are missing qttools5-dev with its dependencies.

    By the way, maybe you will try qtCreator? It is an IDE developed by Qt team, and if you install it just by apt install qtcreator than you will have all necessary dev libs.