diff --git a/modules/gui/src/gosty.cc b/modules/gui/src/gosty.cc
index 06fc2a5dd71a3dcca501d602e78d137ca1abb0b9..ad13d07b313a2a018c66cbe4a0aee89d0579097f 100644
--- a/modules/gui/src/gosty.cc
+++ b/modules/gui/src/gosty.cc
@@ -225,6 +225,9 @@ public:
 
 }
 
+#ifdef _MSC_VER
+  #pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
+#endif
 // initialise gosty - the graphical open structure interpreter
 int main(int argc, char** argv)
 {