Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/main.cpp:16:18: error: variable has incomplete type 'QApplication' #1

Open
w5688414 opened this issue Feb 14, 2019 · 2 comments
Open

Comments

@w5688414
Copy link

when i use make command, the error occurs:
src/main.cpp:16:18: error: variable has incomplete type 'QApplication' QApplication a(argc, argv); ^ /anaconda/include/qt/QtCore/qobject.h:453:18: note: forward declaration of 'QApplication' friend class QApplication; ^ src/main.cpp:45:13: error: use of undeclared identifier 'QMessageBox' QMessageBox::critical(0, ^ src/main.cpp:50:9: error: incomplete type 'QApplication' named in nested name specifier QApplication::setQuitOnLastWindowClosed(false); ^~~~~~~~~~~~~~ /anaconda/include/qt/QtCore/qobject.h:453:18: note: forward declaration of 'QApplication' friend class QApplication; ^ 3 errors generated. make: *** [main.o] Error 1

dmatetelki pushed a commit that referenced this issue Feb 15, 2019
Fixes #1

Is it a Qt5 issue?
@dmatetelki
Copy link
Owner

@w5688414 : I wrote this with Qt4 and still have no problem compiling it with Qt4.

Do you have Qt5? Maybe some coding/include guidelines have changed.

Try my RP branch : https://github.com/dmatetelki/qtmindmap/tree/pr_issue_1 and if it fixes it, i'll merge it.

I've included QApplication there.

@w5688414
Copy link
Author

#include <QApplication> #include <QMessageBox> need to add QMessageBox as well.
it can run normally, but I can't draw, all operations don't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants