对"_imp___ZN12QApplicationC1ERiPPci"的未定义引用
undefined reference to `_imp___ZN12QApplicationC1ERiPPci'
我正在使用CodeBlocks。 如果需要,这是项目:https://i.stack.imgur.com/H6Iyi.png
我是C++非常早期的初学者,我一直在检查RPG游戏(TTU供参考)代码的启动器,试图修复并运行它。 我遇到了一堆我可以轻松修复的错误,但我遇到了这个障碍,我不确定问题是什么。 我想我必须在项目设置中添加Qt的库?但是我不知道在哪里可以找到这些库文件以及要链接哪些文件等。 这是收到以下错误的文件 (core\main.cpp):
#include "uiLauncherWindow.h"
#include <QtWidgetsQApplication>
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) ===|
objDebugLAUNCHERlauncher-win32-mastersrccoremain.o||In function `main':|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrccoremain.cpp|7|undefined reference to `_imp___ZN12QApplicationC1ERiPPci'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrccoremain.cpp|10|undefined reference to `_imp___ZN7QWidget4showEv'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrccoremain.cpp|12|undefined reference to `_imp___ZN12QApplication4execEv'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrccoremain.cpp|12|undefined reference to `_imp___ZN12QApplicationD1Ev'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrccoremain.cpp|12|undefined reference to `_imp___ZN12QApplicationD1Ev'|
objDebugLAUNCHERlauncher-win32-mastersrccoremain.o||In function `ZN7QStringC1EPKc':|
C:Qt5.4msvc2013_64includeQtCoreqstring.h|601|undefined reference to `_imp___ZN7QString16fromAscii_helperEPKci'|
objDebugLAUNCHERlauncher-win32-mastersrccoremain.o||In function `ZN15QTypedArrayDataItE10deallocateEP10QArrayData':|
C:Qt5.4msvc2013_64includeQtCoreqarraydata.h|222|undefined reference to `_imp___ZN10QArrayData10deallocateEPS_jj'|
objDebugLAUNCHERlauncher-win32-mastersrcloginAuthenticator.o||In function `ZN13AuthenticatorC2E4QUrl':|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|17|undefined reference to `_imp___ZN4QUrlC1ERKS_'|
objDebugLAUNCHERlauncher-win32-mastersrcloginAuthenticator.o||In function `ZN13Authenticator5loginERK7QStringS2_S2_':|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|24|undefined reference to `_imp___ZN15QNetworkRequestC1ERK4QUrl'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|25|undefined reference to `_imp___ZN8QVariantC1ERK7QString'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|25|undefined reference to `_imp___ZN15QNetworkRequest9setHeaderENS_12KnownHeadersERK8QVariant'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|25|undefined reference to `_imp___ZN8QVariantD1Ev'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|26|undefined reference to `_imp___ZN8QVariantC1EPKc'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|26|undefined reference to `_imp___ZN15QNetworkRequest9setHeaderENS_12KnownHeadersERK8QVariant'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|26|undefined reference to `_imp___ZN8QVariantD1Ev'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|31|undefined reference to `_imp___ZN21QNetworkAccessManagerC1EP7QObject'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|32|undefined reference to `_imp___ZN21QNetworkAccessManager4postERK15QNetworkRequestRK10QByteArray'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|35|undefined reference to `_imp___ZN10QEventLoopC1EP7QObject'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|37|undefined reference to `_imp___Z13qFlagLocationPKc'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|37|undefined reference to `_imp___Z13qFlagLocationPKc'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|37|undefined reference to `_imp___ZN7QObject7connectEPKS_PKcS1_S3_N2Qt14ConnectionTypeE'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|37|undefined reference to `_imp___ZN11QMetaObject10ConnectionD1Ev'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|38|undefined reference to `_imp___ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|42|undefined reference to `_imp___ZNK13QNetworkReply5errorEv'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|43|undefined reference to `_imp___ZN9QIODevice7readAllEv'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|47|undefined reference to `_imp___ZN7QStringaSERKS_'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|35|undefined reference to `_imp___ZN10QEventLoopD1Ev'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|31|undefined reference to `_imp___ZN21QNetworkAccessManagerD1Ev'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|52|undefined reference to `_imp___ZN15QNetworkRequestD1Ev'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|25|undefined reference to `_imp___ZN8QVariantD1Ev'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|26|undefined reference to `_imp___ZN8QVariantD1Ev'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|35|undefined reference to `_imp___ZN10QEventLoopD1Ev'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|31|undefined reference to `_imp___ZN21QNetworkAccessManagerD1Ev'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|52|undefined reference to `_imp___ZN15QNetworkRequestD1Ev'|
objDebugLAUNCHERlauncher-win32-mastersrcloginAuthenticator.o||In function `ZN13Authenticator17parse_login_replyERK10QByteArray':|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|60|undefined reference to `_imp___ZN7QStringaSERKS_'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|62|undefined reference to `_imp___ZN13QJsonDocument8fromJsonERK10QByteArrayP15QJsonParseError'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|63|undefined reference to `_imp___ZNK13QJsonDocument6objectEv'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|64|undefined reference to `_imp___ZNK11QJsonObject8containsERK7QString'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|68|undefined reference to `_imp___ZN11QJsonObjectixERK7QString'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|71|undefined reference to `_imp___ZNK11QJsonObject8containsERK7QString'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|72|undefined reference to `_imp___ZN11QJsonObjectixERK7QString'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|77|undefined reference to `_imp___ZNK11QJsonObject8containsERK7QString'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|78|undefined reference to `_imp___ZN11QJsonObjectixERK7QString'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|79|undefined reference to `_imp___ZNK11QJsonObject8containsERK7QString'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|80|undefined reference to `_imp___ZN11QJsonObjectixERK7QString'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|63|undefined reference to `_imp___ZN11QJsonObjectD1Ev'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|62|undefined reference to `_imp___ZN13QJsonDocumentD1Ev'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|63|undefined reference to `_imp___ZN11QJsonObjectD1Ev'|
C:UsersThomasDesktopTTULAUNCHERlauncher-win32-mastersrcloginAuthenticator.cpp|62|undefined reference to `_imp___ZN13QJsonDocumentD1Ev'|
objDebugLAUNCHERlauncher-win32-mastersrcloginAuthenticator.o||In function `ZN10QArrayData10sharedNullEv':|
C:Qt5.4msvc2013_64includeQtCoreqarraydata.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)) ===|
那么有人可以解释一下问题到底是什么,以及如何解决它吗? 提前非常感谢你。-英托沙多:)
只需在链接器的编译器设置下添加qt库文件(.lib)>路径即可。也许它无法找到所需的库,因此您需要检查编译器设置
相关文章:
- 对C宏的未定义引用,但在定义它时会出现重新定义错误
- 编译时的 CImg 库返回对"__imp_SetDIBitsToDevice"的未定义引用
- 对Py_Initialize()的未定义引用
- 使用mysql c++连接器的未定义引用
- 对 Scalar ::Scalar() 的未定义引用
- 对复制 CTOR 和 CTOR 的未定义引用
- 对显式实例化的模板函数的未定义引用
- TensorRT (C++ API) 对"createNvOnnxParser_INTERNAL"的未定义引用
- 2个模板化类的非模板友元函数未定义引用错误
- 编译 libfluid 样本控制器时对"event_base_del_virtual"的未定义引用
- 获取对function_name的未定义引用
- 对 'std::thread::_M_start_thread CMake 的未定义引用进行基准测试
- 对结构方法的未定义引用
- 使用内联函数 c++ 的未定义引用
- 对 CMake 中'cudaRegisterLinkedBinary'链接错误的未定义引用?
- 对 DLOPEN 的未定义引用
- QT C++中对全局变量的未定义引用
- 快速数学导致对"__pow_finite"的未定义引用
- 对 boost::system::d etail::system_category_instance 的未定义引用,从
- OpenCV 3.4.3 中对 'cv::String::d eallocate()' 错误的未定义引用