• 5674阅读
  • 2回复

[讨论]最新版qt5在windows下安装后不能编译qt5程序 [复制链接]

上一主题 下一主题
离线vx2008
 

只看楼主 倒序阅读 楼主  发表于: 2014-08-02
安装的版本如下:
qt creator:qt-opensource-windows-x86-msvc2013_64_opengl-5.3.1
qt library:qt-opensource-windows-x86-mingw482-4.8.6-1
电脑原来安装有vs2010,现在调试都设置好了,单编译qt5程序不能通过,qt4可以。

安装qt5自带的编译kit,不能用好像:显示如下:
window.open('http://www.qtcn.org/bbs/attachment/Mon_1408/17_154545_462d2c79f734614.gif?35');" style="max-width:700px;max-height:700px;" onload="if(is_ie6&&this.offsetWidth>700)this.width=700;" >


用library4.8编译qt5如下程序时,总是提示:D:\Program\Qt_Library\src\gui\widgets\qabstractbutton.h:127: error: 'void QAbstractButton::clicked(bool)' is protected     void clicked(bool checked = false);
D:\CloudFile_CF\Qt5.3,1\untitled\main.cpp:12: error: no matching function for call to 'QObject::connect(QPushButton*, void (QAbstractButton::*)(bool), qMain(int, char**)::__lambda0)'
     }); 但是如果将上述代码改成qt4,就可以顺利通过编译
#include <QApplication>#include <QPushButton>#include <QDebug>
int main(int argc, char *argv[]){    QApplication app(argc, argv);
    QPushButton button("Quit");    QObject::connect(&button, &QPushButton::clicked, [](bool) {        qDebug() << "You clicked me!";    });    button.show();
    return app.exec();}

离线dbzhang800

只看该作者 1楼 发表于: 2014-08-03
你机器上有没有装VS2013?没装先装上,装了就在你前述图片中设置一下。
离线vx2008

只看该作者 2楼 发表于: 2014-08-03
谢谢,果然如此
快速回复
限100 字节
 
上一个 下一个