A
Andrew Koenig
Ram Laxman said: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
There are several bugs in VC++ 6.0 that affect programs that use vector and
related classes.
Before you do anything else, be sure that the latest service pack for VC++
6.0 (which I think is Service Pack 4) is installed, as it fixes a number of
those bugs.
One bug that is not fixed, and might be related to your problem, is this:
using std::vector;
vector<int>::size_type i;
This code should work, but doesn't work in VC++ 6.0; instead, you have to
say
std::vector<int>::size_type i;
I *think*, but am not certain, that even this latter version of the code
requires Service Pack 4.