Jack Jack - 1 year ago 159
C++ Question

Not found include <QtCore/qglobal.h>

So I'm trying to create a dll using QT creator. I went to

new project -> libary -> C++ libary -> choose
. It generated automatically a header file with
global
prefix and a include header that can't be found:

#include <QtCore/qglobal.h>


give the error:


error: QtGlobal: No such file or directory


I find that this header is being included to use
Q_DECL_EXPORT
macro so I searched where this is defined:
here
. So I did
#include <QtGlobal>
header but get same error.

What's the source of error and how can I fix this?

Answer Source

Found the solution!

The QT creator created the project with the following line in the .pro file:

 QT -= core gui 

Note the -= operator, this was preventing the linking of core library then the not found of #include <QtCore/qglobal.h> just removed the core from that line and it compiled fine.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download