- 论坛徽章:
- 0
|
我是第一次在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. |
|