diff --git a/core/DebuggerUI.cc b/core/DebuggerUI.cc
index 0cb245bd6355967b7ad08ebce5b1f264cb7f6036..e12e1de2ee9163a99dfb854bc8ddf2651ee31786 100644
--- a/core/DebuggerUI.cc
+++ b/core/DebuggerUI.cc
@@ -221,8 +221,12 @@ void TTCN_Debugger_UI::init()
   // read history from file, don't bother if it does not exist
   read_history(ttcn3_history_filename);
   // set our own command completion function
+#ifdef WIN32
+  rl_completion_entry_function = (Function*)complete_command;
+#else
   rl_completion_entry_function = complete_command;
 #endif
+#endif
 }
 
 void TTCN_Debugger_UI::clean_up()
diff --git a/mctr2/cli/Cli.cc b/mctr2/cli/Cli.cc
index fe80aab7ba4379a5aba5b34f413402436bec3960..c88388adfdec63928b5761eea2d7b7b1d4b34985 100644
--- a/mctr2/cli/Cli.cc
+++ b/mctr2/cli/Cli.cc
@@ -372,7 +372,11 @@ int Cli::interactiveMode()
   // Read history from file, don't bother if it does not exist!
   read_history(ttcn3_history_filename);
   // Set our own command completion function
+#ifdef WIN32
+  rl_completion_entry_function = (Function*)completeCommand;
+#else
   rl_completion_entry_function = completeCommand;
+#endif
   // Override rl_getc() in order to detect shell mode
   rl_getc_function = getcWithShellDetection;