diff --git a/core/utils/src/rlibmap.cxx b/core/utils/src/rlibmap.cxx
index 0ec9051baa7a940172539b092fbe826072d933af..dfa9c7c3be36c445f19248bb6c810c09482fc837 100644
--- a/core/utils/src/rlibmap.cxx
+++ b/core/utils/src/rlibmap.cxx
@@ -381,8 +381,8 @@ int main(int argc, char **argv)
       }
       if (!strcmp(argv[ic], "-o")) {
          ic++;
-#ifdef WIN32
          std::string outfile(argv[ic]);
+#ifdef WIN32
          FromCygToNativePath(outfile);
          fp = fopen(outfile.c_str(), "w");
 #else
@@ -397,8 +397,8 @@ int main(int argc, char **argv)
       if (!strcmp(argv[ic], "-r")) {
          replace = true;
          ic++;
-#ifdef WIN32
          std::string outfile(argv[ic]);
+#ifdef WIN32
          FromCygToNativePath(outfile);
          fp = fopen(outfile.c_str(), "a+");
 #else