免费注册 查看新帖 |

Chinaunix

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

aix中使用stl找不到头文件的问题? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-09-27 08:49 |只看该作者 |倒序浏览
我是第一次在aix进行编程,第一个hello world就搞了很久,结果用了cc_r编译,才可以运行.\r\n现在我编写了一个vector的小程序,但是编译不过,说找不到vector头文件,不知道为什么?\r\n我在usr/include中的确找不到这个头文件.是不是这个原因呢?\r\n程序如下:\r\n#include \"stdio.h\"\r\n#include <vector>\r\nusing namespace std;\r\nvoid main(void)\r\n{\r\n        int a[10]={1,3,9,13,15,3,21,18,3,38};\r\n        vector<int> vec(a,a+10);\r\n        vector<int>::iterator iter=vec.begin();\r\n        for(;iter!=vec.end();iter++)\r\n                printf(\"%d \",*iter);\r\n        printf(\"\\n\");\r\n        printf(\"hello world\\n\");\r\n}\r\n\r\n编译及错误提示如下:\r\n$cc_r -o hello hello.c\r\n\"hello.c\", line 2.10: 1506-296 (S) #include file <vector> not found.\r\n\"hello.c\", line 3.1: 1506-166 (S) Definition of function using requires parentheses.\r\n\"hello.c\", line 3.7: 1506-276 (S) Syntax error: possible missing \'{\'?\r\n\"hello.c\", line 7.16: 1506-046 (S) Syntax error.\r\n\"hello.c\", line 7.9: 1506-045 (S) Undeclared identifier vector.\r\n\"hello.c\", line 8.16: 1506-046 (S) Syntax error.\r\n\"hello.c\", line 8.22: 1506-045 (S) Undeclared identifier iterator.\r\n\"hello.c\", line 9.20: 1506-021 (S) Expecting struct or union.\r\n\"hello.c\", line 9.14: 1506-045 (S) Undeclared identifier iter.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP