LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 796|回复: 1

STL 预编译通过但是不能实现一个实例

[复制链接]
发表于 2006-3-6 16:12:51 | 显示全部楼层 |阅读模式

  1. #include <string>
  2. #include <list>
  3. #include <deque>
  4. #include <vector>
  5.             
  6. #include <bits/stl_list.h>
  7. #include <bits/stl_deque.h>
  8. #include <bits/stl_vector.h>

  9.    
  10. int main(void)
  11. {
  12. #if 0
  13.     vector<int>& Vec;
  14. #endif

  15.     return 0;
  16. }   
复制代码

系统是Fedore Core3 ,关掉条件编译则成功,打开则失败,错误如下:

  1. [root@root STL]# g++ test.cpp -o test
  2. test.cpp: In function `int main()':
  3. test.cpp:15: error: `vector' undeclared (first use this function)
  4. test.cpp:15: error: (Each undeclared identifier is reported only once for each function it appears in.)
  5. test.cpp:15: error: expected primary-expression before "int"
  6. test.cpp:15: error: expected `;' before "int"
  7. [root@root STL]#
复制代码
发表于 2006-3-6 17:20:47 | 显示全部楼层
using namespace std
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表