diff --git a/Code/Learning/otbListSampleGenerator.txx b/Code/Learning/otbListSampleGenerator.txx
index b4875c5cacbe961f02ad0cb455c7a992d6f1687b..58b664cefaee96934b22c74d2a873d5a7f93e325 100644
--- a/Code/Learning/otbListSampleGenerator.txx
+++ b/Code/Learning/otbListSampleGenerator.txx
@@ -24,6 +24,8 @@
 #include "otbRemoteSensingRegion.h"
 #include "otbVectorDataProjectionFilter.h"
 
+#include "otbMacro.h"
+
 namespace otb
 {
 
@@ -270,6 +272,7 @@ ListSampleGenerator<TImage, TVectorData>
     }
   else
     {
+    otbWarningMacro("no polygon found");
     m_ClassMinSize = 0;
     m_NumberOfClasses = 0;
     }