#include "wx/wxprec.h"
 
 #include "wx/gdiobj.h"
-#include "wx/gdicmn.h"
-#include "wx/font.h"
 
-IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
+#ifndef WX_PRECOMP
+    #include "wx/font.h"
+    #include "wx/gdicmn.h"
+#endif
 
 class wxStockGDIPM: public wxStockGDI
 {