Code::Blocks Forums

User forums => Help => Topic started by: sima_sandouk on August 18, 2022, 02:53:00 pm

Title: I need some help with tweaking the way Code::Blocks complier builds projects..
Post by: sima_sandouk on August 18, 2022, 02:53:00 pm
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!
Title: Re: I need some help with tweaking the way Code::Blocks complier builds projects..
Post by: Miguel Gimenez on August 18, 2022, 02:58:46 pm
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.
Title: Re: I need some help with tweaking the way Code::Blocks complier builds projects..
Post by: MortenMacFly on August 22, 2022, 05:33:53 pm
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:
https://sourceforge.net/p/codeblocks/code/HEAD/tree/trunk/src/batch_build_all_31.bat