I faced the same problem. I have fixed out by going to Setting -> Compiler -> Global Compiler Settings -> Toolchain Execuatables (tab). There, click on Program Files and then rename C compiler to gcc.exe and C++ compiler to g++.exe.

Answer from SilverSurfer on Stack Overflow
🌐
Code::Blocks
wiki.codeblocks.org › index.php › Installing_a_supported_compiler
Installing a supported compiler - Code::Blocks
In other words, it is not known yet whether these compilers still work with Code::Blocks. ... The official MinGW website is now here. A MinGW-bundled version of the latest Code::Blocks release is available from the Code::Blocks download page. If you install this version, the GCC compiler will be automatically detected and set as the default.
Discussions

gcc - Adding compiler to code::blocks - Stack Overflow
From here I've downloaded newest release of GCC, namely 4.6. How can I add this compiler to my code::blocks? More on stackoverflow.com
🌐 stackoverflow.com
codeblocks - Can't find file executable in your configured search path for gnc gcc compiler - Stack Overflow
For that you need to install binary of GNU GCC compiler, which comes with MinGW package. You can download MinGW( and put it under C:/ ) and later you have to download gnu -c, c++ related Binaries, so select required package and install them(in the MinGW ). Then in the Code::Blocks, go to Setting, ... More on stackoverflow.com
🌐 stackoverflow.com
Trouble with Installation of GNU GCC compiler for C++ in Code::Blocks
Open cmd and type g++ --version to see if the GNU C++ compiler installed correctly. Then use this to make sure that Code::Blocks sees that compiler to use for your coding projects. More on reddit.com
🌐 r/techsupport
1
1
June 7, 2017
Problem with Codeblocks. Can't seem to locate compiler.
If you are on Windows, just install Visual Studio . It's a by far superior IDE and you get the compiler installed along with it. More on reddit.com
🌐 r/cpp_questions
6
2
September 9, 2020
🌐
Quora
quora.com › How-do-I-download-and-install-a-GNU-GCC-compiler-in-Code-Blocks
How to download and install a GNU GCC compiler in Code::Blocks - Quora
Answer: You can get a Code::Blocks install that comes with a version of GCC bundled with it. I would however recommend not installing that. You could install GCC manually via the download section on their website.
🌐
Universidad de Cantabria
personales.unican.es › corcuerp › ProgCpp › install_codeblocks.html
How To Install Code::Blocks in Windows and Get Started
Verify the Compiler's and Debugger's Path: (for CodeBlocks xx.xx for Windows) Goto "Settings" menu ⇒ "Compiler..." ⇒ In "Selected Compiler", choose "GNU GCC Compiler" ⇒ Select tab "Toolchain Executables" ⇒ Check the "Compiler's Installation Directory".
🌐
YouTube
youtube.com › cmteq
Fix - Code blocks can't find GNU GCC Compiler - YouTube
This quick tutorial will assist to set up code blocks compiler in a situation where you have installed the compiler separate from the IDE.Code::Blocks is an ...
Published   February 10, 2022
Views   24K
🌐
Lanecc
media.lanecc.edu › users › birdb › CS133G › CodeBlocks Troubleshooting.html
Code::Blocks Troubleshooting Tips
On the Code::Blocks menu, go to "Settings", next click on "Compiler and Debugger...". This will open the "Compiler and debugger settings dialog". Under "Selected compiler" select the name of the compiler you are using. For most of you it will be "GNU GCC Compiler".
Find elsewhere
Top answer
1 of 10
111

I'm guessing you've installed Code::Blocks but not installed or set up GCC yet. I'm assuming you're on Windows, based on your comments about Visual Studio; if you're on a different platform, the steps for setting up GCC should be similar but not identical.

First you'll need to download GCC. There are lots and lots of different builds; personally, I use the 64-bit build of TDM-GCC. The setup for this might be a bit more complex than you'd care for, so you can go for the 32-bit version or just grab a preconfigured Code::Blocks/TDM-GCC setup here.

Once your setup is done, go ahead and launch Code::Blocks. You don't need to create a project or write any code yet; we're just here to set stuff up or double-check your setup, depending on how you opted to install GCC.

Go into the Settings menu, then select Global compiler settings in the sidebar, and select the Toolchain executables tab. Make sure the Compiler's installation directory textbox matches the folder you installed GCC into. For me, this is C:\TDM-GCC-64. Your path will vary, and this is completely fine; just make sure the path in the textbox is the same as the path you installed to. Pay careful attention to the warning note Code::Blocks shows: this folder must have a bin subfolder which will contain all the relevant GCC executables. If you look into the folder the textbox shows and there isn't a bin subfolder there, you probably have the wrong installation folder specified.

Now, in that same Toolchain executables screen, go through the individual Program Files boxes one by one and verify that the filenames shown in each are correct. You'll want some variation of the following:

  • C compiler: gcc.exe (mine shows x86_64-w64-mingw32-gcc.exe)
  • C++ compiler: g++.exe (mine shows x86_64-w64-mingw32-g++.exe)
  • Linker for dynamic libs: g++.exe (mine shows x86_64-w64-mingw32-g++.exe)
  • Linker for static libs: gcc-ar.exe (mine shows x86_64-w64-mingw32-gcc-ar.exe)
  • Debugger: GDB/CDB debugger: Default
  • Resource compiler: windres.exe (mine shows windres.exe)
  • Make program: make.exe (mine shows mingw32-make.exe)

Again, note that all of these files are in the bin subfolder of the folder shown in the Compiler installation folder box - if you can't find these files, you probably have the wrong folder specified. It's okay if the filenames aren't a perfect match, though; different GCC builds might have differently prefixed filenames, as you can see from my setup.

Once you're done with all that, go ahead and click OK. You can restart Code::Blocks if you'd like, just to confirm the changes will stick even if there's a crash (I've had occasional glitches where Code::Blocks will crash and forget any settings changed since the last launch).

Now, you should be all set. Go ahead and try your little section of code again. You'll want int main(void) to be int main(), but everything else looks good. Try building and running it and see what happens. It should run successfully.

2 of 10
42

Just open your setting->compiler and click on the reset defaults and it will start work.

🌐
Code::Blocks
forums.codeblocks.org › index.php
GNU GCC compiler for C/C++
February 19, 2016 - Using Code::Blocks » · GNU GCC compiler for C/C++ « previous next » · Send this topic · Print · Pages: [1] Go Down · Send this topic · Print · Pages: [1] Go Up · « previous next » · Code::Blocks Forums » · User forums » · Using Code::Blocks » ·
🌐
NTU Singapore
www3.ntu.edu.sg › home › ehchua › programming › howto › CodeBlocks_HowTo.html
CodeBlocks for C/C++ Programming
Verify the Compiler's and Debugger's Path: (For CodeBlocks 13.12 For Windows) Goto "Settings" menu ⇒ "Compiler..." ⇒ In "Selected Compiler", choose "GNU GCC Compiler" ⇒ Select tab "Toolchain Executables" ⇒ Check the "Compiler's Installation Directory".
🌐
Sololearn
sololearn.com › en › Discuss › 2036003 › gnu-gcc-compiler-codeblocks
GNU GCC COMPILER (CODE::BLOCKS) | Sololearn: Learn to code for FREE!
October 13, 2019 - Probably the toolchain path within the compiler options is not setup correctly?! Do you have a compiler installed? Goto "Settings->Compiler...->Global compiler settings->GNU GCC Compiler->Toolchain executables" and fix the compiler's setup.
🌐
Guru99
guru99.com › home › c programming › how to download and install gcc compiler in c for windows pc
How to Download and Install GCC Compiler in C for Windows PC
August 8, 2024 - Choose the installer with GCC Compiler, e.g., codeblocks-17.12mingw-setup.exe which includes MinGW’s GNU GCC compiler download and GNU GDB debugger with Code::Blocks source files.
🌐
Reddit
reddit.com › r/techsupport › trouble with installation of gnu gcc compiler for c++ in code::blocks
r/techsupport on Reddit: Trouble with Installation of GNU GCC compiler for C++ in Code::Blocks
June 7, 2017 -

Hello World! I just downloaded Code::Blocks to learn how to code with SoloLearn on Win7 professional64. When i try to run the "Hello World" script, i get the following error message:

"SoloLearn1 - Debug": The compiler's setup (GNU GCC Compiler) is invalid, so Code::Blocks cannot find/run the compiler. Probably the toolchain path within the compiler options is not setup correctly?! (Do you have a compiler installed?) Goto "Settings->Compiler...->Global compiler settings->GNU GCC Compiler->Toolchain executables" and fix the compiler's setup. Skipping...

Also, there is a message in the bottom right corner saying:

Can't find compiler executable in your configured search paths for GNU GCC compiler

I downloaded and executed win-builds-1.5 to get the GNU compiler and made it install everything. Which files do i have to choose in the given window in Code::Blocks?

Thank you in advance!

🌐
Uta
ranger.uta.edu › ~alex › courses › 1310 › lectures › 01_install_CodeBlocks.pdf pdf
How to install Code::Blocks Alexandra Stefan 1 1/22/2024
Download codeblocks-20.03mingw-setup.exe - this is the package that has both Code::Blocks and a · C compiler (the MinGW C compiler). If you already have a C compiler or prefer to install the C compiler · separate, download the appropriate package (e.g. codeblocks-20.03-setup.exe).
🌐
Code::Blocks
forums.codeblocks.org › index.php
can't find compiler executable in your search path (GNU GCC compiler)
January 4, 2013 - can't find compiler executable in your search path (GNU GCC compiler)
🌐
Code::Blocks
codeblocks.org › downloads › binaries
Binary releases - Code::Blocks
August 24, 2025 - NOTE: The codeblocks-25.03-setup.exe file includes Code::Blocks with all plugins. The codeblocks-25.03-setup-nonadmin.exe file is provided for convenience to users that do not have administrator rights on their machine(s). NOTE: The codeblocks-25.03mingw-setup.exe file includes additionally the GCC/G++/GFortran/Clang compiler and GDB debugger from WinLibs project (version 14.2.0, 32/64 bit).
🌐
Technobyte
technobyte.org › install-code-blocks-gcc-compiler-first-c-program-windows-10
Install CodeBlocks, GCC compiler & run your first C program - Windows 10
March 2, 2020 - A guide to properly installing the latest version of CodeBlocks with the GCC compiler and testing it with your first C program.
🌐
Code::Blocks
forums.codeblocks.org › index.php
The compiler's setup (GNU GCC Compiler) is invalid, but i can't find a cpu match
The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .
🌐
GNU
gcc.gnu.org
GCC, the GNU Compiler Collection - GNU Project
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Objective-C++, Fortran, Ada, Go, D, Modula-2, COBOL, Rust, and Algol 68 as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the GNU operating system.