免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4342 | 回复: 5
打印 上一主题 下一主题

编写了一qt程序,运行不了。倒 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-08-09 18:44 |只看该作者 |倒序浏览
执行nake时出现如下信息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. -I/usr/lib/qt-3.1/include -o hello.o hello.cpp
hello.cpp:1:24: QApplication: 没有那个文件或目录
hello.cpp:2:23: QPushButton: 没有那个文件或目录
hello.cpp: In function `int main(int, char**)':
hello.cpp:4: `QApplication' undeclared (first use this function)
hello.cpp:4: (Each undeclared identifier is reported only once for each
   function it appears in.)
hello.cpp:4: parse error before `(' token
hello.cpp:5: `QPushButton' undeclared (first use this function)
hello.cpp:6: `b' undeclared (first use this function)
hello.cpp:7: `QObject' undeclared (first use this function)
hello.cpp:7: parse error before `::' token
hello.cpp:8: `app' undeclared (first use this function)
hello.cpp:4: warning: unused parameter `int argc'
hello.cpp:4: warning: unused parameter `char**argv'
make: *** [hello.o] Error 1
帮忙看一下,不胜感激

论坛徽章:
1
午马
日期:2013-08-23 23:39:47
2 [报告]
发表于 2009-08-09 18:54 |只看该作者
找本书,配好环境,从hello world开始,从书第一章开始看

论坛徽章:
0
3 [报告]
发表于 2009-08-09 18:57 |只看该作者
apt-get install libqt4-opengl-dev

论坛徽章:
0
4 [报告]
发表于 2009-08-09 20:19 |只看该作者
我找到原因了
是我的qt版本太低了。书上的例子跟我用的 qt不匹配
红帽9能装qt4.0以上的版本不

论坛徽章:
0
5 [报告]
发表于 2009-08-09 21:42 |只看该作者
原帖由 lyf3560 于 2009-8-9 20:19 发表
我找到原因了
是我的qt版本太低了。书上的例子跟我用的 qt不匹配
红帽9能装qt4.0以上的版本不

你还是换 REDHAT AS 5吧完全安装直接集成了的

论坛徽章:
0
6 [报告]
发表于 2009-08-10 10:04 |只看该作者
红帽9可以装qt4.0以上的版本
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP