亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
最近訪問板塊 發(fā)新帖
查看: 1337 | 回復(fù): 0
打印 上一主題 下一主題

[C++] qt的問題 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2014-04-07 16:39 |只看該作者 |倒序?yàn)g覽
以下是一個(gè)簡(jiǎn)單的程序,共3個(gè)文件(main.cpp, qtdemo.cpp, qtdemo.h),詳細(xì)代碼如下:
  1. 1)main.cpp
  2. #include <QApplication>
  3. #include <qtdemo.h>
  4.                                                                                 
  5. int main(int argc, char **argv)
  6. {
  7.         QApplication a(argc, argv);
  8.         Demo *demo = new Demo;
  9.                                                                                 
  10.         demo->setGeometry(300,300,100,100);
  11.         demo->setWindowTitle("Qt Demo");
  12.         demo->show();
  13.                                                                                 
  14.         return a.exec();
  15. }
復(fù)制代碼
  1. 2)qtdemo.cpp
  2. #include <QLabel>
  3. #include <QVBoxLayout>
  4. #include <QPushButton>
  5. #include "qtdemo.h"
  6.                                                                                 
  7. Demo::Demo()
  8. {
  9.         string = new QLabel(tr("This is a QT Demo!!"));
  10.         string->setFont(QFont("Times",20, QFont::Bold));
  11.         string->setAlignment(Qt::AlignHCenter);
  12.                                                                                 
  13.         button = new QPushButton("Quit");
  14.         button->setFont(QFont("Times",15, QFont::Bold));
  15.                                                                                 
  16.         vlayout = new QVBoxLayout;
  17.         vlayout->addWidget(string);
  18.         vlayout->addWidget(button);
  19.         setLayout(vlayout);
  20.                                                                                 
  21.         connect(button,SINGAL(clicked()),this,SLOT(close()));
  22. }
復(fù)制代碼
  1. 3)qtdemo.h
  2. #ifndef __QTDEMO__
  3. #define __QTDEMO__
  4.                                                                                 
  5. #include <QWidget>
  6. class QLabel;
  7. class QVBoxLayout;
  8. class QPushButton;
  9.                                                                                 
  10. class Demo:public QWidget
  11. {
  12. public:
  13.         Demo();
  14. private:
  15.         QLabel *string;
  16.         QVBoxLayout *vlayout;
  17.         QPushButton *button;
  18. };
  19.                                                                                 
  20. #endif
復(fù)制代碼
問題:
執(zhí)行qtmake -project 以及 qtmake 都成功,但執(zhí)行 make 時(shí)報(bào)錯(cuò),錯(cuò)誤提示如下:
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB
-DQT_SHARED -I/usr/local/Trolltech/Qt-4.5.3/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.5.3/include/QtCore -I/usr/local/Trolltech/Qt-4.5.3/include/QtGui -I/usr/local/Trolltech/Qt-4.5.3/include -I. -I. -o qtdemo.o qtdemo.cpp
qtdemo.cpp: In constructor `Demo:emo()':
qtdemo.cpp:20: `clicked' undeclared (first use this function)
qtdemo.cpp:20: (Each undeclared identifier is reported only once for each
   function it appears in.)
qtdemo.cpp:20: `SINGAL' undeclared (first use this function)
make: *** [qtdemo.o] Error 1


運(yùn)行環(huán)境:
redhat 9
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP