// Watcom C++ gives a linker error if this is compiled in.
// With Borland C++, all samples crash if this is compiled in.
-#if !defined(__WATCOMC__) && !(defined(__BORLANDC__) && (__BORLANDC__ < 0x520)) && !defined(__CYGWIN10__)
+#if wxUSE_OLE &&!defined(__WATCOMC__) && !(defined(__BORLANDC__) && (__BORLANDC__ < 0x520)) && !defined(__CYGWIN10__)
#include "wx/log.h"
#include "wx/msw/ole/automtn.h"