[geeks] VC++ STL vector

Joshua D Boyd jdboyd at cs.millersville.edu
Wed Sep 25 11:44:51 CDT 2002


Alright, I do
#include <vector>
in a program in VC++.

I can below use #ifdef _VECTOR_ to see that the vector library was
indeed loaded.  But, when I try to actually use the vector, like so:
vector <int> i;
I get the compiler errors
c:\documents and settings\jdboyd.cspc\desktop\base\worldtest.h(23) :
error C2143: syntax error : missing ';' before '<'
c:\documents and settings\jdboyd.cspc\desktop\base\worldtest.h(23) :
error C2501: 'vector' : missing storage-class or type specifiers
c:\documents and settings\jdboyd.cspc\desktop\base\worldtest.h(23) :
error C2059: syntax error : '<'
c:\documents and settings\jdboyd.cspc\desktop\base\worldtest.h(23) :
error C2238: unexpected token(s) preceding ';'

WTF?  This same program, using the STL vector works fine at home under
GCC 2.95.  How can it be loaded the vector header file but not reading
the class definition?

-- 
Joshua D. Boyd



More information about the geeks mailing list