diff --git a/preprocessor/DynareBison.yy b/preprocessor/DynareBison.yy
index a59e5d20dd4bb55c0ce0022180f9ce40b2852034..6199ad1b43171f5230c5241be061fc138805cf28 100644
--- a/preprocessor/DynareBison.yy
+++ b/preprocessor/DynareBison.yy
@@ -28,8 +28,6 @@
    with the prologue.
 */
 %{
-using namespace std;
-
 class ParsingDriver;
 
 #include "ExprNode.hh"
diff --git a/preprocessor/ExprNode.hh b/preprocessor/ExprNode.hh
index 65199d6608ddcd825e028e4dd20e6868fe42ae14..aebdead2b1f425953ad7b114f128ead84fd2536d 100644
--- a/preprocessor/ExprNode.hh
+++ b/preprocessor/ExprNode.hh
@@ -20,13 +20,13 @@
 #ifndef _EXPR_NODE_HH
 #define _EXPR_NODE_HH
 
-using namespace std;
-
 #include <set>
 #include <map>
 #include <vector>
 #include <ostream>
 
+using namespace std;
+
 #include "SymbolTable.hh"
 #include "CodeInterpreter.hh"
 #include "ExternalFunctionsTable.hh"
diff --git a/preprocessor/macro/MacroBison.yy b/preprocessor/macro/MacroBison.yy
index 260bc77de9c25c43d43b3e8662633eb65572ed44..20a5c2c349c6bda7f60bc7de6d43273a9d46e48d 100644
--- a/preprocessor/macro/MacroBison.yy
+++ b/preprocessor/macro/MacroBison.yy
@@ -28,8 +28,6 @@
    with the prologue.
 */
 %{
-using namespace std;
-
 #include "MacroValue.hh"
 
 class MacroDriver;
diff --git a/preprocessor/macro/MacroValue.hh b/preprocessor/macro/MacroValue.hh
index d79c024c5d6113aea36f7ad428d9e7fe82db6f31..25016478120b5a4e1bbe2dd9e3249a8c7fb7b597 100644
--- a/preprocessor/macro/MacroValue.hh
+++ b/preprocessor/macro/MacroValue.hh
@@ -20,12 +20,12 @@
 #ifndef _MACRO_VALUE_HH
 #define _MACRO_VALUE_HH
 
-using namespace std;
-
 #include <string>
 #include <vector>
 #include <sstream>
 
+using namespace std;
+
 class MacroDriver;
 
 //! Base class for representing values in macro language