diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp
index e1cf2e06b12e3b85df5f74bbd750da14d1c2f4f1..8d2ece39a7766075d83c62334ae25e25e4d1bf02 100644
--- a/Geo/GModel.cpp
+++ b/Geo/GModel.cpp
@@ -3,6 +3,7 @@
 // See the LICENSE.txt file for license information. Please report all
 // bugs and problems to <gmsh@geuz.org>.
 
+#include <limits>
 #include <stdlib.h>
 #include <sstream>
 #include <stack>
@@ -578,7 +579,7 @@ int GModel::adaptMesh(std::vector<int> technique,
       char name[256];
       sprintf(name, "meshAdapt-%d.msh", ITER);
       writeMSH(name);
-      //metric->exportInfo(name);
+      metric->exportInfo(name);
 
       if (ITER++ >= niter)  break;
       if (ITER > 3 && fabs((double)(nbElems - nbElemsOld)) < 0.01 * nbElemsOld) break;
diff --git a/Geo/GModelIO_BDF.cpp b/Geo/GModelIO_BDF.cpp
index 23fee9d620a2dca1c81e45a717cf1950ffe535a8..2decedd0e6af11634579a9ba83ba76a870aabe0c 100644
--- a/Geo/GModelIO_BDF.cpp
+++ b/Geo/GModelIO_BDF.cpp
@@ -3,6 +3,8 @@
 // See the LICENSE.txt file for license information. Please report all
 // bugs and problems to <gmsh@geuz.org>.
 
+#include <stdlib.h>
+#include <string.h>
 #include "GModel.h"
 #include "MPoint.h"
 #include "MLine.h"
diff --git a/Geo/GModelIO_DIFF.cpp b/Geo/GModelIO_DIFF.cpp
index 58cee819d805bdef88c6cea7bc561931232d1ea5..079fe25b159eb9361f50840fe70d80874ca45f3f 100644
--- a/Geo/GModelIO_DIFF.cpp
+++ b/Geo/GModelIO_DIFF.cpp
@@ -3,6 +3,8 @@
 // See the LICENSE.txt file for license information. Please report all
 // bugs and problems to <gmsh@geuz.org>.
 
+#include <stdlib.h>
+#include <string.h>
 #include "GModel.h"
 #include "MElement.h"
 
diff --git a/Geo/GModelIO_MESH.cpp b/Geo/GModelIO_MESH.cpp
index dcd0b6ec0e09e64de0f49abbb0e6b5ee616aaf4c..0081084e608a72862966fce963e185a2819e0fb7 100644
--- a/Geo/GModelIO_MESH.cpp
+++ b/Geo/GModelIO_MESH.cpp
@@ -3,6 +3,8 @@
 // See the LICENSE.txt file for license information. Please report all
 // bugs and problems to <gmsh@geuz.org>.
 
+#include <stdlib.h>
+#include <string.h>
 #include "GModel.h"
 #include "MLine.h"
 #include "MTriangle.h"
diff --git a/Geo/GModelIO_PLY.cpp b/Geo/GModelIO_PLY.cpp
index 44bd8817719aa0591f6123de3276bed11a32a15e..408036ad622c4bdfdeb849de63db7e0eea455eb7 100644
--- a/Geo/GModelIO_PLY.cpp
+++ b/Geo/GModelIO_PLY.cpp
@@ -3,6 +3,8 @@
 // See the LICENSE.txt file for license information. Please report all
 // bugs and problems to <gmsh@geuz.org>.
 
+#include <stdlib.h>
+#include <string.h>
 #include "GmshConfig.h"
 #include "GModel.h"
 #include "MTriangle.h"
diff --git a/Geo/GModelIO_UNV.cpp b/Geo/GModelIO_UNV.cpp
index 1dc2a17e2c5a1c694e1f6987dfa4838ce5791b13..132afebc1e0f770244f7294ecb55f91a5affc534 100644
--- a/Geo/GModelIO_UNV.cpp
+++ b/Geo/GModelIO_UNV.cpp
@@ -3,6 +3,8 @@
 // See the LICENSE.txt file for license information. Please report all
 // bugs and problems to <gmsh@geuz.org>.
 
+#include <stdlib.h>
+#include <string.h>
 #include "GModel.h"
 #include "MLine.h"
 #include "MTriangle.h"
diff --git a/Geo/GModelIO_VRML.cpp b/Geo/GModelIO_VRML.cpp
index e17d956a7e81e490ea3683641639732a915d0bf9..c93e9c63d6762f8d8a4b0075d02ff8c16bdb2e0f 100644
--- a/Geo/GModelIO_VRML.cpp
+++ b/Geo/GModelIO_VRML.cpp
@@ -3,6 +3,8 @@
 // See the LICENSE.txt file for license information. Please report all
 // bugs and problems to <gmsh@geuz.org>.
 
+#include <stdlib.h>
+#include <string.h>
 #include "GModel.h"
 #include "MLine.h"
 #include "MTriangle.h"