diff --git a/Modules/Learning/Supervised/include/otbRandomForestsMachineLearningModel.h b/Modules/Learning/Supervised/include/otbRandomForestsMachineLearningModel.h
index e04c7fd19e3c718fe655536959b66d50b63b979d..3de61ce3aa661091913e99af382dfa8e230cf58f 100644
--- a/Modules/Learning/Supervised/include/otbRandomForestsMachineLearningModel.h
+++ b/Modules/Learning/Supervised/include/otbRandomForestsMachineLearningModel.h
@@ -27,12 +27,12 @@
 #include "itkFixedArray.h"
 #include "otbMachineLearningModel.h"
 #include "itkVariableSizeMatrix.h"
-#include "otbCvRTreesWrapper.h"
-
-class CvRTreesWrapper;
 
 namespace otb
 {
+
+class CvRTreesWrapper;
+
 template <class TInputValue, class TTargetValue>
 class ITK_EXPORT RandomForestsMachineLearningModel
   : public MachineLearningModel <TInputValue, TTargetValue>
diff --git a/Modules/Learning/Supervised/include/otbRandomForestsMachineLearningModel.hxx b/Modules/Learning/Supervised/include/otbRandomForestsMachineLearningModel.hxx
index 10508ead57bb89d90b76cc5675731ce864e7786b..a5e70f9130298e0b6371d0656d2148a3c89d1108 100644
--- a/Modules/Learning/Supervised/include/otbRandomForestsMachineLearningModel.hxx
+++ b/Modules/Learning/Supervised/include/otbRandomForestsMachineLearningModel.hxx
@@ -25,6 +25,7 @@
 #include "itkMacro.h"
 #include "otbRandomForestsMachineLearningModel.h"
 #include "otbOpenCVUtils.h"
+#include "otbCvRTreesWrapper.h"
 
 namespace otb
 {