diff --git a/Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.hxx b/Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.hxx
index cfe1cac226458bbc256102423e2888aa29e638a2..5588ccbe7aa87ea58510da4a4dcbd423a1fd1f77 100644
--- a/Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.hxx
+++ b/Modules/Learning/Supervised/include/otbLibSVMMachineLearningModel.hxx
@@ -66,7 +66,7 @@ LibSVMMachineLearningModel<TInputValue,TOutputValue>
   this->m_Problem.l = 0;
   this->m_Problem.y = nullptr;
   this->m_Problem.x = nullptr;
-#ifndef NDEBUG
+#ifdef NDEBUG
   svm_set_print_string_function(&otb::Utils::PrintNothing);
 #endif
 }