Qt 5.5.1/minGW 4.9.2:链接器;找不到lQt5Core“;

Qt 5.5.1/minGW 4.9.2:链接器;找不到lQt5Core“;,qt,linker-errors,Qt,Linker Errors,我正试图根据《用Qt4进行C++-GUI编程》一书从源代码构建一个helloworld项目。在包含源文件的文件夹中,我使用qmake-project创建了一个项目文件(“test.pro”),使用qmake-test.pro创建了一个makefile(“makefile”)。当我运行mingw32 make时,我收到以下错误: C:/Program Files/mingw-w64/x86_64-4.9.2-win32-seh-rt_v4-rev4/mingw64/bin/。/lib/gcc/x8

我正试图根据《用Qt4进行C++-GUI编程》一书从源代码构建一个helloworld项目。在包含源文件的文件夹中,我使用qmake-project创建了一个项目文件(“test.pro”),使用qmake-test.pro创建了一个makefile(“makefile”)。当我运行mingw32 make时,我收到以下错误:

C:/Program Files/mingw-w64/x86_64-4.9.2-win32-seh-rt_v4-rev4/mingw64/bin/。/lib/gcc/x86_64-w64-mingw32/4.9.2/。/../../../../../../x86_64-w64-mingw32/bin/ld.exe:找不到-lQt5Core

collect2.exe:错误:ld返回了1个退出状态

Makefile.Release:77:目标“Release\test.exe”的配方失败

mingw32生成[1]:***[release\test.exe]错误1

mingw32 make[1]:离开目录“C:/Users/Staeng/Documents/artofarithmetic/test”

makefile:34:目标“发布”的配方失败

mingw32 make:**[发布]错误2

有类似问题的人被告知手动将一些Qt库包含到项目文件中。但是,我不想在每次引入新库时都必须手动编辑项目文件,就我(目前非常有限)的理解而言,qmake应该做所有讨厌的工作

我在一台Windows 8.1 x64机器上,使用Qt 5.5.1 for minGW和gcc 4.9.2(“x86_64-win32-seh-rev4,由minGW-W64项目构建”)。我哪里出错了

非常感谢

源文件:

// test.cpp
#include <QtWidgets/QApplication>
#include <QtWidgets/QLabel>

int main(int argc, char** argv){
    QApplication app(argc, argv);
    QLabel* label = new QLabel("Hello Qt!");
    label->show();

    return app.exec();
}

也许您应该添加“QT+=核心gui小部件”在test.pro文件中。

为什么不使用Qt Creator?@adlag当我用Qt Creator打开test.pro文件并尝试构建项目时,我得到错误:release/test.o:文件未识别:文件格式未识别collect2.exe:错误:ld返回1退出status@adlag当我从头开始创建新项目时,它与Qt Creator一起工作,至少这是一个好的开始。
# test.pro
######################################################################
# Automatically generated by qmake (3.0) Tue Dec 29 00:58:35 2015
######################################################################

TEMPLATE = app
TARGET = test
INCLUDEPATH += .

# Input
SOURCES += test.cpp