diff --git a/Mesh/meshGRegionBoundaryRecovery.cpp b/Mesh/meshGRegionBoundaryRecovery.cpp
index 91996a197500880cf225c24ba144ff23f7517df8..62b27c30e5275bf8ec373266cfaeabd00e86fa47 100644
--- a/Mesh/meshGRegionBoundaryRecovery.cpp
+++ b/Mesh/meshGRegionBoundaryRecovery.cpp
@@ -5,6 +5,7 @@
 
 #include <stdio.h>
 #include <assert.h>
+#include "GmshConfig.h"
 #include "meshGRegionBoundaryRecovery.h"
 #include "meshGRegionDelaunayInsertion.h"
 #include "robustPredicates.h"
@@ -16,6 +17,16 @@
 #include "MTetrahedron.h"
 #include "OS.h"
 
+#if defined(HAVE_TETGEN)
+
+bool meshGRegionBoundaryRecovery(GRegion *gr)
+{
+  Msg::Error("Should not call meshGRegionBoundaryRecovery with Tetgen");
+  return false;
+}
+
+#else
+
 #define REAL double
 
 // dummy tetgenio class (not used)
@@ -857,3 +868,5 @@ bool tetgenmesh::reconstructmesh(void *p)
  return returnValue;
 
 }
+
+#endif