I don't use precompiled headers and I include all needed headers myself (without wx/wx.h).
I noticed that I never include <wx/setup.h> (which seems to be important).
The usual way of doing this seems to be including <wx/wxprec.h>, which includes <wx/defs.h> which inludes <wx/platform.h> which then includes <wx/setup.h>.
I also noticed that <wx/wxprec.h> includes a lot more before it includes <wx/wx.h>, if WX_PRECOMP is set.
Code: Select all
#ifdef WX_PRECOMP // include "wx/wxchar.h" first to ensure that UNICODE macro is correctly set // _before_ including <windows.h> #include "wx/wxchar.h" // include standard Windows headers #if defined(__WXMSW__) #include "wx/msw/wrapwin.h" #include "wx/msw/wrapcctl.h" #include "wx/msw/wrapcdlg.h" #include "wx/msw/private.h" #include "wx/msw/missing.h" #endif