问题描述
我在VC ++编译器中使用了vector。我已经包含了
#include< string>
#include< algorithm>
#include< vector>
std :: vector< int> field;
std :: vector< int> :: size_type i;
test.cpp(135):错误C2653:''std'':不是类或命名空间名称
错误C2143:语法错误:缺少'';''之前''<''
错误C2501:''vector'':缺少存储空间-class或类型说明符
错误C2143:语法错误:缺少'';''之前''<''
错误C2653:''std'':是不是类或命名空间名称
有谁知道是什么问题?
问候
Bubunia
I have used vector in the VC++ compiler. I have included
#include <string>
#include <algorithm>
#include <vector>
std::vector<int> field;
std::vector <int>::size_type i;
test.cpp(135) : error C2653: ''std'' : is not a class or namespace name
error C2143: syntax error : missing '';'' before ''<''
error C2501: ''vector'' : missing storage-class or type specifiers
error C2143: syntax error : missing '';'' before ''<''
error C2653: ''std'' : is not a class or namespace name
Does anybody know what is the problem??
Regards
Bubunia
推荐答案
VC ++ 6支持
向量,你的代码看起来是正确的。所以你发布的代码
不是你编译的代码,或者你的编译器安装错误(或许是错误的b $ b)头文件的位置。
john
vector is supported by VC++6 and your code looks correct. So either the code
you''ve posted isn''t the code you''ve compiled, or your compiler is installed
incorrectly (perhaps its looking in the wrong places for header files).
john
在没有std ::的情况下试试吧。
Try it without "std::".
你显然没有发布产生上述错误的代码所以
它很难帮助你。你有没有试过编译你自己发布的6条线?
Mike
You obviously haven''t posted the code that produced the above error so
it will be hard to help you. Have you tried compiling the 6 lines you
have posted by themselves?
Mike
这篇关于VC ++ 6.0不支持Vector吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!