简体   繁体   English

Qt5无法在Windows 8上编译

[英]Qt5 won't compile on windows 8

I just downloaded QT for the first time. 我是第一次下载QT。 I installed the new 5.0RC2 SDK. 我安装了新的5.0RC2 SDK。 I created a new project and set the compiler to mingw C:\\MinGW\\bin\\gcc.exe http://doc.qt.digia.com/qtcreator-2.4/creator-tool-chains.html 我创建了一个新项目,并将编译器设置为mingw C:\\MinGW\\bin\\gcc.exe http://doc.qt.digia.com/qtcreator-2.4/creator-tool-chains.html

But if I try to compile it I get tons of error message that look like this 但是,如果我尝试对其进行编译,则会收到大量类似以下的错误消息

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

I also set the compiler in kit to mingw and the device type to desktop. 我还将工具包中的编译器设置为mingw,将设备类型设置为桌面。

Any ideas what went wrong? 任何想法出了什么问题?

Edit: 编辑:

Okay I probably know the problem. 好吧,我可能知道这个问题。 http://qt-project.org/downloads QT5 is only available for vs2010.( It's a little bit hidden). http://qt-project.org/downloads QT5仅适用于vs2010。(有点隐藏)。 I just try QT 4.8 for mingw then. 我只是尝试使用mingw的QT 4.8。

try adding this line in the .pro 尝试在.pro中添加此行

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

replace the path to the lib folder in yours. 替换您的lib文件夹的路径。 and QWidget4.a from similar one that the error says and available in the lib folder. QWidget4.a的类似QWidget4.a ,可在lib文件夹中找到。

this is just a suggestion. 这只是一个建议。 have a try. 试试。

As you discovered yourself, Qt5.0.0 is currently only released for VS2010 on Windows. 如您所知,Qt5.0.0当前仅在Windows上针对VS2010发布。 There are some problems with compiling the webkit component for MinGW. 为MinGW编译webkit组件存在一些问题。 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). 如果您可以不使用Webkit(嵌入式浏览器)而生活,则可以自己编译(我只是在针对64位和32位MinGW的全新Win8安装中做到了)。 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!. 所有这一切都需要有点“ Unixy”的摆弄,并非所有Windows用户都可以适应-但是,您还是想使用MinGW而不是MSVC!

Since Stackoverflow will not allow me to post more than one link, I posted my recipe here: http://silmor.de/qtstuff.qt5mingw.php 由于Stackoverflow不允许我发布多个链接,因此我在这里发布了自己的食谱: http : //silmor.de/qtstuff.qt5mingw.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM