查看完整版本: [-- helloworld例子在rhel自带的qt下编译错误 --]

QTCN开发网 -> 《零基础学Qt4编程》专栏 -> helloworld例子在rhel自带的qt下编译错误 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

deanyz 2013-08-16 01:52

helloworld例子在rhel自带的qt下编译错误

  1. #include <qapplication.h>
    #include <qpushbutton.h>
    int main(int argc, char *argv[])
    {
       QApplication app(argc,argv);
       QPushButton pushButton( QObject::tr("Hello Qt !") );
       pushButton.show();
       QObject::connect(&pushButton,SIGNAL(clicked()),&app,SLOT(quit()));
       return app.exec();
    }

    书中的第一个例子,我在RHEL4,Qt 3.3.3 make出错,请问这个错误怎么改?
  1. helloqt.cpp:6: error: no matching function for call to `QPushButton::QPushButton(QString)'


realfan 2013-08-16 08:49
用的Qt什么版本,如果是5.0以上,要在pro中加
QT += widgets


查看完整版本: [-- helloworld例子在rhel自带的qt下编译错误 --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled