Archived

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

anthr4x-

'using namespace std' problems

Recommended Posts

ok, in one of my header files, ive declared ''using namespace std;''. Later on in one of me source files, im using a function that returns an ifstream class. When I try to compile, i get error C2872: ''ifstream'': ambiguous symbol. Anyone have any idea how to fix this? I''ve scoured MSDN for any solutions, and have came up with nothing. I practically have that error memorized comments/questions/fixes/flames?

Share this post


Link to post
Share on other sites
Never import the std namespace in header files. Use explicit import.


i.e In header file, do this

void F( std::string &s );

rather than

using namespace std;

void F( string &s );

Share this post


Link to post
Share on other sites