CodeBlocks Can’t Find Compiler? Here Is the Solution!

CodeBlocks is a popular IDE for C and C++ development. A compiler is required to run any C or C++ code. There are various types of compilers. Those compilers help us to run and debug the code. In some cases, we can see that the Compiler does not work correctly or is through different errors even for running the 'Hello World' program. This makes every new programmer frustrated. In this article, I will show you how you can solve the code blocks compiler problem.


CodeBlocks Can’t Find Compiler? Here Is the Solution!

How to Solve CodeBlocks Can't Find Compiler Problem

Here is the common error message you will see after launching code blocks 'can't find the compiler executable in your search path (GNU GCC compiler)'. It means the Compiler can't be detected by code blocks. Most of the time, this problem can be solved by following the steps below:

Step 1: Go to the settings tab of your code blocks

Settings tab CodeBocks

Step 2: Go to the compiler settings

Compiler settings CodeBocks

Step 3: Reset the compiler settings to default by clicking on 'Reset Defaults'

Reset the compiler settings CodeBlocks

Step 4: Go to the 'toolchain executable' tab and auto-detect compiler's installation directory

toolchain executable CodeBlocks

Most of the time 'can't find compiler executable in your configured search path for gnu gcc compiler' error appears because of this mismatch of the compiler installation directory. I always install code blocks in the c drive to eliminate this. Again it is not a big issue because when you click on the auto detect button, it automatically detects the Compiler's installation directory. After completing the above steps, your problem going to be solved. If it still doesn't work, then check the process explained below.

Why CodeBlocks Can’t Find Compiler?

There are some common reasons that your Code::Blocks is not getting any compiler. Here are some common reasons why your CodeBlocks can't find a compiler:

  • You installed the CodeBlocks without the compilers
  • Wrong installation of CodeBlocks

Many people download CodeBlocks without the MinGW and don't install it separately. If you don't know how to get and install MinGW separately, you should download CodeBlocks with MinGW. Here is an article about how to install CodeBlocks properly.

Again with proper installation of MinGW, you can run C and C++ from any drive of your device, and it also helps you to run C/C++ in VS Code. Here is an article about How to Run C/C++ in Visual Studio Code.

Conclusion

Sometimes you can solve the problem by uninstalling and installing the CodeBlocks with MinGW. Restart your device and try again. Comment below for any questions you have.

Author: Sakib Mahmud

This article is from Sakib Mahmud.
(Computer science student from Bangladesh)


  • Published: 3 Dec 2022
  • Last Update: 4 Dec 2022

⚫ More Article from eSakib: