Qt 项目不编译,未定义引用

问题描述 投票:0回答:1

Main.cpp

#include <QApplication>
int main (int argc, char* argv[]) {
    QApplication app(argc, argv);

    return app.exec();
}

test.pro

SOURCES += \
    main.cpp
greaterThan(QT_MAJOR_VERSION,4) : QT +=widgets

outputs :

由于“未定义的引用”,我无法编译我的项目,似乎我的编译器没有找到“QApplication”,但我不知道如何解决它。 我卸载并重新安装我的 Qt 但它没有修复它。

c++ qt mingw undefined-reference qapplication
1个回答
0
投票

检查编译器类型“MinGW 64 位”。
您可以更改类型:Projects->Build & Run 64-bit or 32-bit (target devices)

链接:Qt Creator

© www.soinside.com 2019 - 2024. All rights reserved.