STL in MSVC6.0

Started by
3 comments, last by BriarLoDeran 23 years, 9 months ago
I was under the impression that to use the STL in MSVC++ 6.0 all you had to do was include this little line: using namespace std; I know I have done this before, but now I get this error: error C2871: ''std'' : does not exist or is not a namespace I can''t think of a single setting I''ve changed since using it last. Has anyone else run into this problem and/or have a solution? Thanks, ->Briar LoDeran <-
Advertisement
1) You have to also include the libraries you want to use, i.e. any of the libraries that don''t end in ".h". These all have namespace std declared in them.

2) Make sure you get the service packs. They''re up to SP4 now.
Well I''ve got SP4 on here. Also, I forgot to mention this, but the program I was compiling was as follows:

using namespace std;

int main(void)
{

return (0);
}

...not much to go wrong, eh?

-> Briar LoDeran <-
Like the dude above you just said, you need to include an stl header before doing the using namespace std. or, you can do

namespace std { };
using namespace std;

Wow...I'm a fool...

Of course! If I want to use strings, I have to

#include < string >

Thanks for pointing out the obvious!

-> Briar LoDeran <-



Edited by - BriarLoDeran on July 13, 2000 7:01:37 PM

This topic is closed to new replies.

Advertisement