Question

OK, so I downloaded Codeblocks and I already have a cygwin terminal on my computer that I regularly use to compile and run C programs, but when I try to build a program in CodeBlocks, it gives me an error:

The compiler's setup (GNU GCC Compiler) is invalid, so Code::Blocks cannot find/run the compiler.

I don't know why it can't find my compiler or why it's looking for GNU GCC compiler when I have Cygwin GCC as the default compiler.

Was it helpful?

Solution

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.

OTHER TIPS

I know this is an old question but let me see if I can help. First of all, on the download page make sure you downloaded codeblocks-13.12mingw-setup.exe and NOT codeblocks-13.12-setup.exe. Of course the version numbers may change but pay attention to the name. Then after installing codeblocks, go to Settings->Compiler->Toolchain executables. From here, change the C compiler to gcc.exe and C++ compiler to g++.exe. Hope this helps anyone else going through this problem :-)

If you change the default path of codeblocks while installation, then you may be suffering from this problem.

If you go to Settings>Global compiler settings>Toolchain executables(tab) and see the Compiler's installation directory, it may be set by default to C:\MinGW something like that.

Just press the Auto-detect button and it will find the actual directory of the compiler.

Click OK and you are ready to Code!

I think the major problem is that most of us creates a project and then applies the Compiler's configuration and waits till the project applies the configured changes.

Well , this is TOTALLY WRONG if you created the project before configuring the Compiler , the project won't change it's Compiler , so you need to reconfigure your created project by : Right Click on the project -> Select Build Options -> Reconfigure the selected compiler to CygwinGCC .

I think you have not set your compiler.You have to choose the compiler you want to use. For this purpose click 'Settings'-> 'Compiler and Debugger' and select 'Other Settings' in the drop-down field.Choose your own compiler and save it.Now rerun your program.

Go to:

Settings -> Compiler... -> Toolchain executables(Tab)

In the compiler's installation directory choose the folder where your compiler is.

valter

I solved this problem I firstly downloaded codeblocks-17.12-setup.exe and then added MinGW directory location at Setting -> Compiler -> Global Compiler Settings -> Toolchain Execuatables (tab) -> compiler installation directory" but it did n't work then downloaded codeblocks-13.12mingw-setup.exe and did the same process again and it worked.

Go for this tutorial

As you already have a compiler installed, start from item "Code::Blocks Configuration".

In a nutshell,

1.Settings - Compiler

2.Select Compiler

3.Go for Toolchain executables

4.Find your compiler installation directory and configure the settings accordingly

5.Settings - Debugger

6.Select Default in the drop-down menu

7.Fill in the textbox Executable path with the correct path

8.Click OK, close the window and you are good to go.

I tried this way :

  1. You need to download tdm64-gcc 9.2.0 or current version.
  2. Run it and in the setup, click create.
  3. Select MinGW / TDM (32-bit) - Next.
  4. Installation Directory - Next.
  5. Select the type of instal -> TDM-GCC - 32

In the options below make sure that the "Add to path" option is checked. - Next.

On codeblocks:

Settings
     Compiler
          Toolchain
          executables
          Auto-detect

Settings
     Debugger
          Default
   Executable
   path: C:\TDM-GCC-32\bin\gdb32.exe

i have just solved the problem.

it happening because the path of you compilers is not correct in settings.code blocks downloads and installs compilers for you. you don not need to it manually. thus in some cases it takes wrong path of location of compilers.

now heres the solution:- 1. right click on code blocks and go to properties and copy its location,and open command promt tpye cd and past the location. if you know what this all about then just go to file where your code block is install.

2.you will found MinGW directory or folder.

3.right click on the folder, copy its location

4.open code blocks,go to settings which u will find in menu.

5.go to compilers and then go to toolchain executable

6.u will see compiler's installation directory past our location in white box below that.

  1. CLICK OK

you have solved ur problem. if this dose not work then try reinstalling

I have just solved this problem.

In addition to above mentioned solutions , you can follow the path in "Setting -> Compiler -> Global Compiler Settings -> Toolchain Execuatables (tab)" and check the path for Compiler's installation directory. If it is blank, then click on "Auto Detect" tab. It will update the installation directory.

I just solved the problem. Click 'Settings->Compiler and debugger->Toolchain executables'.Now in "Compiler's installation directory" click on 'Auto-detect' or browse to the path of compiler. It can be found usually at "C:\Program Files (x86)\CodeBlocks-EP\MinGW", if Codeblocks is installed in C-drive.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top