[英]Qt5 undefined reference to `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類,但仍然遇到相同的錯誤。
事實證明,由於某種原因,此行引起了所有麻煩:
#include <QtDeclarative/QDeclarativeView>
請記住,啟用調試時QtQuick1和QtQuick2之間是有區別的:
QtQuick1
#include <QtDeclarative/qdeclarativedebug.h>
QDeclarativeDebuggingEnabler enabler;
QtQuick2
#include <QQmlDebuggingEnabler>
QQmlDebuggingEnabler enabler;
由於您使用的是Qt5.4,並且自從Qt5以來,QtQuick2就已經存在了,這可能就是問題所在。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.