diff --git a/docs/changes.txt b/docs/changes.txt index 90845023ec..fb3f9a60c3 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -197,6 +197,7 @@ Unix: wxMSW: - compilation fix for VC++ command line build (missing version.mak) +- fixed release mode build with VC 7.x (Martin Ecker) - compilation fix for XRC with mingw32 diff --git a/src/common/object.cpp b/src/common/object.cpp index bbbf5350e3..248862a7e9 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -5,7 +5,7 @@ // Modified by: Ron Lee // Created: 04/01/98 // RCS-ID: $Id$ -// Copyright: (c) 1998 Julian Smart and Markus Holzem +// Copyright: (c) 1998 Julian Smart // (c) 2001 Ron Lee // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// @@ -43,11 +43,22 @@ #endif #endif // __WXDEBUG__ || wxUSE_DEBUG_CONTEXT +// we must disable optimizations for VC.NET because otherwise its too eager +// linker discards wxClassInfo objects in release build thus breaking many, +// many things +#if defined _MSC_VER && _MSC_VER >= 1300 + #pragma optimize("", off) +#endif wxClassInfo wxObject::sm_classwxObject( wxT("wxObject"), 0, 0, (int) sizeof(wxObject), (wxObjectConstructorFn) 0 ); +// restore optimizations +#if defined _MSC_VER && _MSC_VER >= 1300 + #pragma optimize("", on) +#endif + wxClassInfo* wxClassInfo::sm_first = NULL; wxHashTable* wxClassInfo::sm_classTable = NULL;