Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QAction: No such file or directory

Tags:

c++

qt

qt4

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?

like image 961
develoops Avatar asked Nov 25 '11 21:11

develoops


2 Answers

For me I had some stale moc_ and ui_ files left over from compiling under a different version and configuration of Qt, so removing them solved the problem for me.

rm moc_* ui_* *.o
like image 146
Cory Klein Avatar answered Oct 12 '22 23:10

Cory Klein


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

like image 38
PeterT Avatar answered Oct 13 '22 00:10

PeterT