• 3846阅读
  • 1回复

hello这个最简单的程序 出问题了--请教大家 不胜感激 [复制链接]

上一主题 下一主题
离线fzusuper
 
只看楼主 倒序阅读 楼主  发表于: 2008-11-27
— 本帖被 XChinux 执行加亮操作(2008-11-30) —
为什么我的hello出问题,我在#qmake-project  #qmake #make都没有提示错误,但是在生成可执行hello后,我运行./hello
结果提示:
Session management error:Authentication Rejected.None of the authentication protocols specified are supported and host-based authentication failed

我就不明白错在哪里,另外我是装QT3 操作系统是redhat9 2.4.20
请大侠指教,不胜感激~~!!

贴上原程序:#include<qapplication.h>
#incldue<qlabel.h>
int main(int argc,char **argv)
{
      QAppliaction app(argc,argv);
QLabel *hello=new QLabel(“hello Qt/Embedded !”,0);
app.setMainWidget(hello);
hello->show();
return app.exec();
}
离线llm08
只看该作者 1楼 发表于: 2008-12-15
可以把程序改成这样试试:
  #nclude <qwidget.h>
      #include<qlabel.h>
      #include<qapplication.h>
    class Hello:public QWidget
  {
    public:
                Hello();
    private:
                QLabel *label;
    };
    Hello::Hello()
    {
          setGeometry(100,100,200,200);
          label = new QLabel("hello Qt/Embedded !",this);
    }
    int main(int argc,char **argv)
    {
      QAppliaction app(argc,argv);
      Hello hello;
      app.setMainWidget(hello);
      hello.show();
      return app.exec();
    }
快速回复
限100 字节
 
上一个 下一个