diff --git a/RenderSystems/Direct3D9/src/OgreD3D9Plugin.cpp b/RenderSystems/Direct3D9/src/OgreD3D9Plugin.cpp
index 6c08fd5da0..84a48b58e9 100644
--- a/RenderSystems/Direct3D9/src/OgreD3D9Plugin.cpp
+++ b/RenderSystems/Direct3D9/src/OgreD3D9Plugin.cpp
@@ -33,6 +33,7 @@ THE SOFTWARE.
 extern "C" {   
 #include "OgreMinGWSupport.h"
 void _chkstk();
+void __security_check_cookie(intptr_t i);
 }   
 #endif
 
diff --git a/RenderSystems/Direct3D9/src/OgreMinGWSupport.cpp b/RenderSystems/Direct3D9/src/OgreMinGWSupport.cpp
index 4bc377ac09..9a6fef69d7 100644
--- a/RenderSystems/Direct3D9/src/OgreMinGWSupport.cpp
+++ b/RenderSystems/Direct3D9/src/OgreMinGWSupport.cpp
@@ -44,7 +44,9 @@ extern "C" {
     
     // MSVC uses security cookies to prevent some buffer overflow attacks.
     // provide dummy implementations.
-    void __security_check_cookie(intptr_t i)
+    intptr_t __security_cookie;
+    
+    void __security_check_cookie(intptr_t i)
     {
     }
 }
