QAction: No such file or directory

c++, qt, qt4

Solution

Make sure that you have the right include paths set up.

If you use QMake the `*.pro` should contain these settings if you want to include files from `QtGui`. They should be set by default but some templates may not set them.

CONFIG += qt
QT += gui

If you use another build system then make sure that you either use

#include <QtGui/QAction>

or you add `$QTDIR/include/QtGui` and not just `$QTDIR/include` to your include path

Problem

I'm getting the error QAction: No such file or directory when I try to compile a project for plugin (C++ Library template). Weird, because I have a project for my app which also includes this header and there is no error. What might cause this?

Original source