views:

94

answers:

1

In Xcode using LLVM 2.0, when I put the line using namespace std; in my C++ code, I get this warning:

Semantic Issue
Using directive refers to implicitly-defined namespace 'std'

Is there a way to fix this? Why is it giving that warning?

+4  A: 

Have you included any standard header files? Otherwise the compiler doesn't know about namespace std.

Please post more code to clarify.

Motti
Ah, I just figured it out. You're right, the line `using namespace std;` was the first line (besides the #ifndef and #define statements of course) in the file; I moved it after the line `#include <iostream>` and it eliminated the warning. GCC never gave that warning, so I never thought about it before. Thanks!
jfm429