Archived

This topic is now archived and is closed to further replies.

STL in MSVC6.0

This topic is 6364 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 <-

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 <-

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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;

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites