By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,435 Members | 2,891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,435 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Minh wrote:
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
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.