Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LLVM Compiler 2.0: Warning with "using namespace std;"

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?

like image 469
Justin Mrkva Avatar asked Oct 17 '10 06:10

Justin Mrkva


2 Answers

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

Please post more code to clarify.

like image 169
Motti Avatar answered Oct 08 '22 02:10

Motti


Moving the using namespace std to after the #include can eliminate this warning.

like image 43
jtony Avatar answered Oct 08 '22 01:10

jtony