Qt5 undefined 引用 'QDeclarativeDebuggingEnabler::QDeclarativeDebuggingEnabler()'



突然有了这个问题…

classitem.o: In function `__static_initialization_and_destruction_0':
/../../Qt/5.4/gcc_64/include/QtDeclarative/qdeclarativedebug.h:50: undefined reference to `QDeclarativeDebuggingEnabler::QDeclarativeDebuggingEnabler()'
collect2: error: ld returned 1 exit status
make: *** [MedJournal] Error 1
09:29:05: The process "/usr/bin/make" exited with code 2.

从对象中剥离了QObject类,但仍然得到相同的错误。

请记住,在启用调试时,QtQuick1和QtQuick2是不同的:

QtQuick1

#include <QtDeclarative/qdeclarativedebug.h>
QDeclarativeDebuggingEnabler enabler;

QtQuick2

#include <QQmlDebuggingEnabler>
QQmlDebuggingEnabler enabler;

因为你正在使用Qt5.4和QtQuick2是围绕自Qt5我认为,这可能是问题。

事实证明,由于某种原因,这一行引起了所有的麻烦:

#include <QtDeclarative/QDeclarativeView>

相关内容

  • 没有找到相关文章

最新更新