2014-12-26 52 views
0

我正在使用CodeBlocks。這是該項目,如果需要的話:http://i.imgur.com/Wz8Bya9.png未定義引用`_imp___ZN12QApplicationC1ERiPPci'

我是一個非常非常早期的C++初學者,我一直在爲RPG遊戲(TTU參考)代碼嘗試修復並運行它的啓動程序。我遇到了一堆我很容易修復的錯誤,但是我遇到了這個障礙,我不確定問題在哪裏。我想我必須在項目設置中添加來自Qt的庫?但我不知道我會找到這些庫文件,哪些鏈接,等等。這是文件(核心\ main.cpp中),這是獲得這些錯誤:

#include "ui\LauncherWindow.h" 

#include <QtWidgets\QApplication> 

int main(int argc, char *argv[]) 
{ 
    QApplication app(argc, argv); 

    LauncherWindow *launcher_window = new LauncherWindow; 
    launcher_window->show(); 

    return app.exec(); 
} 

而且我越來越這些錯誤:

||=== Build: Debug in TTU_launcher_rebuilt (compiler: GNU GCC Compiler) ===| 
obj\Debug\LAUNCHER\launcher-win32-master\src\core\main.o||In function `main':| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\core\main.cpp|7|undefined reference to `_imp___ZN12QApplicationC1ERiPPci'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\core\main.cpp|10|undefined reference to `_imp___ZN7QWidget4showEv'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\core\main.cpp|12|undefined reference to `_imp___ZN12QApplication4execEv'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\core\main.cpp|12|undefined reference to `_imp___ZN12QApplicationD1Ev'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\core\main.cpp|12|undefined reference to `_imp___ZN12QApplicationD1Ev'| 
obj\Debug\LAUNCHER\launcher-win32-master\src\core\main.o||In function `ZN7QStringC1EPKc':| 
C:\Qt\5.4\msvc2013_64\include\QtCore\qstring.h|601|undefined reference to `_imp___ZN7QString16fromAscii_helperEPKci'| 
obj\Debug\LAUNCHER\launcher-win32-master\src\core\main.o||In function `ZN15QTypedArrayDataItE10deallocateEP10QArrayData':| 
C:\Qt\5.4\msvc2013_64\include\QtCore\qarraydata.h|222|undefined reference to `_imp___ZN10QArrayData10deallocateEPS_jj'| 
obj\Debug\LAUNCHER\launcher-win32-master\src\login\Authenticator.o||In function `ZN13AuthenticatorC2E4QUrl':| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|17|undefined reference to `_imp___ZN4QUrlC1ERKS_'| 
obj\Debug\LAUNCHER\launcher-win32-master\src\login\Authenticator.o||In function `ZN13Authenticator5loginERK7QStringS2_S2_':| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|24|undefined reference to `_imp___ZN15QNetworkRequestC1ERK4QUrl'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|25|undefined reference to `_imp___ZN8QVariantC1ERK7QString'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|25|undefined reference to `_imp___ZN15QNetworkRequest9setHeaderENS_12KnownHeadersERK8QVariant'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|25|undefined reference to `_imp___ZN8QVariantD1Ev'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|26|undefined reference to `_imp___ZN8QVariantC1EPKc'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|26|undefined reference to `_imp___ZN15QNetworkRequest9setHeaderENS_12KnownHeadersERK8QVariant'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|26|undefined reference to `_imp___ZN8QVariantD1Ev'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|31|undefined reference to `_imp___ZN21QNetworkAccessManagerC1EP7QObject'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|32|undefined reference to `_imp___ZN21QNetworkAccessManager4postERK15QNetworkRequestRK10QByteArray'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|35|undefined reference to `_imp___ZN10QEventLoopC1EP7QObject'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|37|undefined reference to `_imp___Z13qFlagLocationPKc'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|37|undefined reference to `_imp___Z13qFlagLocationPKc'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|37|undefined reference to `_imp___ZN7QObject7connectEPKS_PKcS1_S3_N2Qt14ConnectionTypeE'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|37|undefined reference to `_imp___ZN11QMetaObject10ConnectionD1Ev'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|38|undefined reference to `_imp___ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|42|undefined reference to `_imp___ZNK13QNetworkReply5errorEv'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|43|undefined reference to `_imp___ZN9QIODevice7readAllEv'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|47|undefined reference to `_imp___ZN7QStringaSERKS_'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|35|undefined reference to `_imp___ZN10QEventLoopD1Ev'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|31|undefined reference to `_imp___ZN21QNetworkAccessManagerD1Ev'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|52|undefined reference to `_imp___ZN15QNetworkRequestD1Ev'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|25|undefined reference to `_imp___ZN8QVariantD1Ev'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|26|undefined reference to `_imp___ZN8QVariantD1Ev'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|35|undefined reference to `_imp___ZN10QEventLoopD1Ev'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|31|undefined reference to `_imp___ZN21QNetworkAccessManagerD1Ev'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|52|undefined reference to `_imp___ZN15QNetworkRequestD1Ev'| 
obj\Debug\LAUNCHER\launcher-win32-master\src\login\Authenticator.o||In function `ZN13Authenticator17parse_login_replyERK10QByteArray':| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|60|undefined reference to `_imp___ZN7QStringaSERKS_'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|62|undefined reference to `_imp___ZN13QJsonDocument8fromJsonERK10QByteArrayP15QJsonParseError'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|63|undefined reference to `_imp___ZNK13QJsonDocument6objectEv'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|64|undefined reference to `_imp___ZNK11QJsonObject8containsERK7QString'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|68|undefined reference to `_imp___ZN11QJsonObjectixERK7QString'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|71|undefined reference to `_imp___ZNK11QJsonObject8containsERK7QString'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|72|undefined reference to `_imp___ZN11QJsonObjectixERK7QString'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|77|undefined reference to `_imp___ZNK11QJsonObject8containsERK7QString'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|78|undefined reference to `_imp___ZN11QJsonObjectixERK7QString'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|79|undefined reference to `_imp___ZNK11QJsonObject8containsERK7QString'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|80|undefined reference to `_imp___ZN11QJsonObjectixERK7QString'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|63|undefined reference to `_imp___ZN11QJsonObjectD1Ev'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|62|undefined reference to `_imp___ZN13QJsonDocumentD1Ev'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|63|undefined reference to `_imp___ZN11QJsonObjectD1Ev'| 
C:\Users\Thomas\Desktop\TTU\LAUNCHER\launcher-win32-master\src\login\Authenticator.cpp|62|undefined reference to `_imp___ZN13QJsonDocumentD1Ev'| 
obj\Debug\LAUNCHER\launcher-win32-master\src\login\Authenticator.o||In function `ZN10QArrayData10sharedNullEv':| 
C:\Qt\5.4\msvc2013_64\include\QtCore\qarraydata.h|116|undefined reference to `_imp___ZN10QArrayData11shared_nullE'| 
||More errors follow but not being shown.| 
||Edit the max errors limit in compiler options...| 
||=== Build failed: 50 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===| 

所以有人可以解釋究竟是什麼問題,以及如何解決它?非常感謝你提前。 -Intoxadox :)

+1

你需要鏈接到Qt。 –

回答

0

只需在編譯器設置>鏈接器下爲qt庫文件(.lib)添加路徑。也許它無法找到所需的庫,所以你需要檢查你的編譯器設置