Author Topic: I need some help with tweaking the way Code::Blocks complier builds projects..  (Read 788 times)

Offline sima_sandouk

  • Single posting newcomer
  • *
  • Posts: 1
I have been looking for a solution on forums and wikis for hours now, and I need some help with a specific problem.

I have hundreds of C++ projects on my PC (Competitive programming is a hobby of mine and I like to keep all my programs) and most of them are built using the default MinGW compiler that comes with the MinGW versions of Code::Blocks for Windows. I recently decided to change my compiler to use the latest TDM-GCC MinGW 64-bit compiler, which comes with support for C++20. It works perfectly for new projects, but I have to rebuild the project using the "Rebuild" option in the "Build" menu for every old project that used the other 32-bit compiler, or else it would show the "Application was unable to start correctly" error. I was wondering, is there a way to make it automatically rebuild the .exe file in the Debug and Release directories without having to manually press Rebuild for each project I want to run? The "Build and Run" option alone isn't enough.

If so, do I have to edit Code::Blocks itself as an open-source software, or is it a kind of command I have to use in Build Options?
I have little to no experience in editing open-source IDEs such as Code::Blocks, so if that's the only solution, I would appreciate a link or two for a guide to help me.

Thank you in advance!

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1303
Take a look at the command line options (execute "codeblocks --help" from a console), possibly you can make a batch file rebuidling all your projects.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9660
You can also have look at how we batch-build Code::Blocks itself. This batch file starts a defined build process (standard / re-build or clean) fro the command line and compiles through all tons of projects files of C::B. Have a look at the sources here:
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: