Author Topic: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1  (Read 14427 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5247
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Search the forum, I see that we have a discussion here: patch to build C::B against wx 3.0 with PCH enabled, its two years ago, not sure the patch is still valid.  ;)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12122
    • Travis build status
Do you want to build 64 bit version of C::B, because the 32bit one builds just fine using the latest TDM build?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5247
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Do you want to build 64 bit version of C::B,
NO. I'm on WinXP 32bit system.

Quote
because the 32bit one builds just fine using the latest TDM build?
Yes, it is "fine", but it is now with PCH disabled when build C::B against wx3.x library, because when enabling pch, the big pch file will cause gcc crash. (the pch file when using wx2.8.12 is a bit small, thus it doesn't cause the gcc crash).
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
So, I can turn on the pch feature when building c::b against wx3.x, anyone knows a simple patch to enable pch on the windows C::B wx30 cbp file?
Just compare the wx28 and wx30 CBP file:

Its basically:
1.) Enable the warning -Winvalid-pch
2.) remove the NOPCH #define
3.) Add the CB_PRECOMP and WX_PRECOMP #define.
4.) Enable compilation of include/sdk.h and include/sdk_precomp.h

...that should be pretty much it. unfortunately you have to do it for all WX30 files... but for the beginning, the SDK, Core and wxSmithXXX might be well enough to speed up compiling a lot.

don't forget to do a re-build.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5247
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Hi, Morten, thanks, I can successfully build CodeBlocks_wx30.cbp with PCH enabled (under gcc 5.2).
I use my own patch here: patch to build C::B against wx 3.0 with PCH enabled

All the method I used will be posted in a single thread: Build C::B against wx3.02 with gcc 5.2 under Windows
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.