1

我是第一次下载QT。我安装了新的 5.0RC2 SDK。我创建了一个新项目并将编译器设置为 mingw C:\MinGW\bin\gcc.exe http://doc.qt.digia.com/qtcreator-2.4/creator-tool-chains.html

但是如果我尝试编译它,我会收到大量看起来像这样的错误消息

C:\Qt\Qt5.0.0-rc2\Tools\QtCreator\bin\GL\main.cpp:8: error: undefined reference to `_imp___ZN7QWidget4showEv'

我还将套件中的编译器设置为 mingw 并将设备类型设置为桌面。

任何想法出了什么问题?

编辑:

好的,我可能知道问题所在。http://qt-project.org/downloads QT5 仅适用于 vs2010。(有点隐藏)。我只是为mingw尝试QT 4.8。

4

2 回答 2

1

尝试在 .pro 中添加这一行

 CONFIG(release, debug|release): LIBS += "C:\\Qt\\4.8.3\\lib\\QWidget4.a"

替换你的lib文件夹的路径。并QWidget4.a来自错误所说的类似错误,并且在 lib 文件夹中可用。

这只是一个建议。试试。

于 2012-12-14T17:14:37.053 回答
0

As you discovered yourself, Qt5.0.0 is currently only released for VS2010 on Windows. There are some problems with compiling the webkit component for MinGW. If you can live without Webkit (embedded browser) you can compile it yourself (I just did that on a fresh Win8 install for both 64bit and 32bit MinGW). All of this requires a bit of very 'Unixy' fiddling that not all Windows users may feel up to - but, heck, you want to use MinGW instead of MSVC anyway!.

Since Stackoverflow will not allow me to post more than one link, I posted my recipe here: http://silmor.de/qtstuff.qt5mingw.php

于 2012-12-31T16:38:42.987 回答