• 5028阅读
  • 3回复

请教qt编译问题 [复制链接]

上一主题 下一主题
离线baojian_322
 

只看楼主 倒序阅读 楼主  发表于: 2006-11-13
请教qt编译问题
我用的是redhat9.0,自带的qt-3.1,刚开始使用,想那个简单程序先运行一下,
当我使用qtdesigner编辑好程序后,运行出现错误,请各位指教。hehe.pro是工程的名字

[lili@localhost lili]$ qmake hehe.pro
[lili@localhost lili]$ make
g++ -c -pipe -Wall -W -O2 -march=i386 -mcpu=i686 -g -DGLX_GLXEXT_LEGACY -fno-use-cxa-atexit -fno-exceptions -DQT_NO_DEBUG -I/usr/lib/qt-3.1/mkspecs/default -I. -I/usr/lib/qt-3.1/include -I.ui/ -I.moc/ -o .obj/main.o main.cpp
main.cpp: In function `int main(int, char**)':
main.cpp:8: `QPushButtton' undeclared (first use this function)
main.cpp:8: (Each undeclared identifier is reported only once for each function
  it appears in.)
main.cpp:8: parse error before `(' token
main.cpp:9: `hellobtn' undeclared (first use this function)
make: *** [.obj/main.o] Error

下面是我的程序:
#include <qapplication.h>
#include <qpushbutton.h>

int main( int argc,char **argv)

{
QApplication a(argc,argv);

QPushButton hellobtn("hello world!",0);
hellobtn.resize(100,20);
a.setMainWidget(&hellobtn);
hellobtn.show();
return a.exec();
}
[ 此贴被XChinux在2006-11-16 22:26重新编辑 ]
离线shiroki

只看该作者 1楼 发表于: 2006-11-16
`QPushButtton' 这里怎么多了个t亚
--
shiro is White
ki is tree
http://www.cuteqt.com
论坛 http://www.cuteqt.com/bbs
博客 http://www.cuteqt.com/blog
博客镜像: http://sites.cuteqt.com/cuteqt
Linux/Qt/嵌入式讨论群 http://qun.qq.com/air/5699823
离线baojian_322

只看该作者 2楼 发表于: 2006-11-16
谢谢您的回复,就是呀,怎么多个“t" 呢 ,我还没有发现呢,但是这是什么问题呢,这是我运行make后得出的结果,不是我编辑的问题,还请各位指教!!谢谢!
离线XChinux

只看该作者 3楼 发表于: 2006-11-16
奇怪的现象,只能重新自己检查一回了。
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
快速回复
限100 字节
 
上一个 下一个