diff --git a/SystemTools.cxx b/SystemTools.cxx
index 75b9ce5b903eda6baf6d2ebda2888cacce941035..12fabb40037e1a55fbb5033da22de290ffaea4cb 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -1399,7 +1399,7 @@ kwsys_std::string SystemTools::GetFilenameLastExtension(const kwsys_std::string&
 {
   kwsys_std::string name = SystemTools::GetFilenameName(filename);
   kwsys_std::string::size_type dot_pos = name.rfind(".");
-  if(dot_pos != std::string::npos)
+  if(dot_pos != kwsys_std::string::npos)
     {
     return name.substr(dot_pos);
     }