diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc
index b4310fc8714f7fba9a53f460b7a318f46ab59ac8..3ee5612f9b35986b68bac0a2134ac960df70a0d6 100644
--- a/preprocessor/ModFile.cc
+++ b/preprocessor/ModFile.cc
@@ -737,13 +737,14 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
           cerr << "ERROR: atanh() function is not supported with USE_DLL option and older MSVC compilers; use Cygwin, MinGW or upgrade your MSVC compiler to 11.0 (2012) or later." << endl;
           exit(EXIT_FAILURE);
         }
-      if (dynamic_model.isTrinaryOpUsed(oNormcdf))
-        {
-          cerr << "ERROR: normcdf() function is not supported with USE_DLL option and older MSVC compilers; use Cygwin, MinGW or upgrade your MSVC compiler to 11.0 (2012) or later." << endl;
-          exit(EXIT_FAILURE);
-        }
     }
 #endif
+  if (use_dll && msvc)
+    if (dynamic_model.isTrinaryOpUsed(oNormcdf))
+      {
+        cerr << "ERROR: normcdf() function is not supported with USE_DLL option and older MSVC compilers; use Cygwin, MinGW or upgrade your MSVC compiler to 11.0 (2012) or later." << endl;
+        exit(EXIT_FAILURE);
+      }
 #endif
 
   // Compile the dynamic MEX file for use_dll option