diff --git a/src/DynareMain.cc b/src/DynareMain.cc
index 6715c6ac9b03c1946081578b2bc27a5a82edb6cb..57857ff0c299b39622b7945e9b09c6aba43475df 100644
--- a/src/DynareMain.cc
+++ b/src/DynareMain.cc
@@ -418,6 +418,15 @@ main(int argc, char **argv)
       pos != string::npos)
     basename.erase(pos);
 
+  // Forbid some basenames, since they will cause trouble (see preprocessor#62)
+  set<string> forbidden_basenames = { "T", "y", "x", "params", "steady_state", "it_", "true" };
+  if (forbidden_basenames.find(basename) != forbidden_basenames.end())
+    {
+      cerr << "ERROR: Please use another name for your .mod file. The one you have chosen ("
+           << argv[1] << ") conflicts with internal Dynare names." << endl;
+      exit(EXIT_FAILURE);
+    }
+
   WarningConsolidation warnings(no_warn);
 
   // Process config file