VC7.1: Compiler Error if include any STL headers (iostream, fstream, string, etc.)

M

Minh

I've just installed VS.NET 2003 on my Athlon XP 1800+. However I couldn't
get any project with STL includes to compile even if I create a new empty
project (and added #include <string>). It gave me a bunch of "missing ;"
errors. I did reinstall the whole thing a few times but it didn't work.

Anyone have any idea?

Thanks

c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(862) :
error C2143: syntax error : missing ';' before '<'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(935) :
see reference to class template instantiation
'std::istreambuf_iterator<_Elem,_Traits>' being compiled
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(862) :
error C2238: unexpected token(s) preceding ';'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(863) :
error C2143: syntax error : missing ';' before '<'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(863) :
error C2238: unexpected token(s) preceding ';'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(866) :
error C2143: syntax error : missing ')' before '*'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(866) :
error C2143: syntax error : missing ';' before '*'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(866) :
error C2864: '_Sb' : only const static integral data members can be
initialized inside a class or struct
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(866) :
error C2501: 'std::istreambuf_iterator<_Elem,_Traits>::_Sb' : missing
storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(866) :
error C2143: syntax error : missing ';' before 'throw'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(866) :
error C2334: unexpected token(s) preceding ':'; skipping apparent function
body
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(871) :
error C2143: syntax error : missing ')' before '&'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(871) :
error C2143: syntax error : missing ';' before '&'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(871) :
error C2059: syntax error : ')'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(871) :
error C2143: syntax error : missing ';' before 'throw'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(871) :
error C2501: 'std::istreambuf_iterator<_Elem,_Traits>::_Istr' : missing
storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(871) :
error C2334: unexpected token(s) preceding ':'; skipping apparent function
body
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(932) :
error C2143: syntax error : missing ';' before '*'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(932) :
error C2501:

........

c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\streambuf(320) :
error C2146: syntax error : missing ';' before identifier 'xsputn'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\streambuf(320) :
error C2433: 'std::basic_streambuf<_Elem,_Traits>::streamsize' : 'virtual'
not permitted on data declarations
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\streambuf(320) :
error C2501: 'std::basic_streambuf<_Elem,_Traits>::streamsize' : missing
storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\streambuf(320) :
fatal error C1003: error count exceeds 100; stopping compilation
 
C

Carl Daniel [VC++ MVP]

Minh said:
I've just installed VS.NET 2003 on my Athlon XP 1800+. However I
couldn't get any project with STL includes to compile even if I
create a new empty project (and added #include <string>). It gave me
a bunch of "missing ;" errors. I did reinstall the whole thing a few
times but it didn't work.

Anyone have any idea?

What did you name the source file you're trying to compile - is it .c or
..cpp? The compiler will assumes files named *.c are C not C++ - that could
be the cause of the errors you're seeing.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top