Author Topic: Thank You; also quick question about build size difference under Code::Blocks  (Read 438 times)

Offline harrismh777

  • Single posting newcomer
  • *
  • Posts: 7
 :)
First,  thank you (team) for Code::Blocks.  The IDE is well thought out, I love the debugger tools, and the configurable perspectives are very helpful.  In my view, an IDE should be fun, as well as efficient and helpful for development. Code::Blocks wins on all three points. Again, thanks!   8)

I'm using the MinGW-W64 compiler (gcc c11) and my first project in Code::Blocks is a rewrite of a terminal utility using linked lists for handling statistical data;  works great !  My question relates to the executable build size,  as it is unexpectedly (surprisingly) small in byte count;  less than 75k.  The original project (same compiler | compile options |link options) was over 125K using compiler invocation at the command line;  or larger!  I moved the new project (from Code::Blocks) to the original directory and built the project, again from the command line;  same thing...  almost 130K.  This is perplexing.  With the same compiler, and the same link and compile options,  the two should be identical sizes (or at least close);  if they were within 5k or less I wouldn't even ask.  But, for the build out of Code::Blocks to be almost half (!) the build size,  it begs the question why?  What am I missing in my understanding of how Code::Blocks works with the MinGW compiler?

I normally use GDB for my debugger (all platforms);  I am really liking the debugger tools in Code::Blocks,  please thank the team members supporting the Code::Blocks debugging suite.

marcus


Offline harrismh777

  • Single posting newcomer
  • *
  • Posts: 7
 ::)  Well, I hate responding to my own posts,  but sometimes it just happens...

Duh,  I decided to dig into the build logs (I now have two projects, a Win32 api gui as well) and the answers are all there.  Although, in my defense, the font is so small in the build logs window pane the logs are difficult to study;  anyway the bottom line is that I was able to create a "MAKE.bat" batch file based on the build logs compile and link options and voila...  now the executable sizes match. 

It would be handy if Code::Blocks had an option for generating a "MAKE.bat" file for stand-alone compile and link (both Debug and Release targets);  perhaps that's already built-in to Code::Blocks,  but I didn't find it. 

Just for nibbles and grins,  the difference has to do with link options.  Also, I discovered the  -mwindows  link option that helps create a stand-alone gui without the console window behind it.  The option gets selected from the Project dropdown, Properties, and then selecting "Console App" or "Gui App" for either target;  by default the Debug target is a Console App (which is handy for getting printf debug messages out of the middle of a gui !  )

Code::Blocks specifies the link options for the three main subsystems;  kernel, user,  gdi.  This is something I had not tried in my command line builds;  anyway,  my MAKE command line build now matches Code::Blocks  build options.  And better,  I think I understand what's going on now.

The more I use Code::Blocks,  the better I like it...  very stable,  easy to use,  and fun.  Just a minor suggestion would be to provide an option to integrate other editors.  For instance it would be handy for some of use to be able to integrate gvim into Code::Blocks for the fast modal style finger editing that we're used to on other platforms.  Again, its just a minor suggestion;  the editor in Code::Blocks is fine;  its just mousier than I am used to (I have VI in the fingers folks).

Have a great Saturday folks!   8)