diff --git a/preprocessor/ExprNode.cc b/preprocessor/ExprNode.cc
index 47d7bc037d524f2a524e1d9e104fbbe74f5979f9..5c799fcc0ac50475a2f68988e2f85e3a7fe065dd 100644
--- a/preprocessor/ExprNode.cc
+++ b/preprocessor/ExprNode.cc
@@ -21,7 +21,11 @@
 #include <iterator>
 #include <algorithm>
 
-#include <ext/functional>
+// For select1st()
+#ifdef __GNUC__
+# include <ext/functional>
+using namespace __gnu_cxx;
+#endif
 
 #include <cassert>
 #include <cmath>
@@ -103,7 +107,7 @@ ExprNode::collectModelLocalVariables(set<int> &result) const
   set<pair<int, int> > symb_ids;
   collectVariables(eModelLocalVariable, symb_ids);
   transform(symb_ids.begin(), symb_ids.end(), inserter(result, result.begin()),
-            __gnu_cxx::select1st<pair<int, int> >());
+            select1st<pair<int, int> >());
 }
 
 void
diff --git a/preprocessor/StaticModel.cc b/preprocessor/StaticModel.cc
index def06c0b52b467657f288991ae0c8e38423bccd4..439a2abe4803c1bbdba14acce24ef27da06be65d 100644
--- a/preprocessor/StaticModel.cc
+++ b/preprocessor/StaticModel.cc
@@ -26,7 +26,11 @@
 #include <functional>
 
 #ifdef DEBUG
-# include <ext/functional>
+// For select2nd()
+# ifdef __GNUC__
+#  include <ext/functional>
+using namespace __gnu_cxx;
+# endif
 #endif
 
 #include <boost/graph/adjacency_list.hpp>
@@ -320,7 +324,7 @@ StaticModel::computeNormalization()
       n1++;
 
       pair<multimap<int, int>::const_iterator, multimap<int, int>::const_iterator> x = natural_endo2eqs.equal_range(i);
-      if (find_if(x.first, x.second, compose1(bind2nd(equal_to<int>(), endo2eq[i]), __gnu_cxx::select2nd<multimap<int, int>::value_type>())) == x.second)
+      if (find_if(x.first, x.second, compose1(bind2nd(equal_to<int>(), endo2eq[i]), select2nd<multimap<int, int>::value_type>())) == x.second)
         cout << "Natural normalization of variable " << symbol_table.getName(symbol_table.getID(eEndogenous, i))
              << " not used." << endl;
       else