469,623 Members | 1,929 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

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

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
1 7125
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.

Similar topics

5 posts views Thread by Patrick Coleman | last post: by
6 posts views Thread by Zenon | last post: by
4 posts views Thread by merlevo | last post: by
1 post views Thread by Hafeez | last post: by
6 posts views Thread by c++newbie | last post: by
8 posts views Thread by ambar.shome | last post: by
6 posts views Thread by Baloff | last post: by
1 post views Thread by Gary Wessle | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.