Code::Blocks

User forums => Help => Topic started by: pb910 on January 04, 2013, 08:02:32 pm

Title: can't find compiler executable in your search path (GNU GCC compiler)
Post by: pb910 on January 04, 2013, 08:02:32 pm
Hi,

I've been trying for 1 and a half hours to set code blocks up, I've tried various downloads, and i've searched on the internet for a while but could not understand the material.

I am getting the following error messages "can't find compiler executable in your search path(GNU GCC compiler)"

I downloaded the version of codeblocks that came bundled with minGW, so I thought that it would have came with a compiler?

I have very little knowledge about compilers, codeblocks, or operating systems.

I am using Windows 7. I downloaded the 3rd download on this page: http://www.codeblocks.org/downloads/26#windows .

Thank you.
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: laYahooz on January 04, 2013, 11:06:00 pm
I had a similar problem. Please note I'm a total n00b in C++ and IDE's but heres what I did (after some research)
So of course I downloaded the version that came with the compiler and it didn't work. Heres what I did:
1) go to settings in the upper part
2) click compiler
3) choose reset to defaults.

Hopefully this works  :-\
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: pb910 on January 06, 2013, 12:56:37 am
yes that worked, thanks  :)
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: blahzay on March 29, 2013, 03:53:25 pm
yes thanks, that worked for me too. 
 :)
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: natedoggy on April 11, 2013, 03:14:46 am
Unfortunately it did not work for me.
ANy other tips that might work. I've done what you have said installed and tried other compilers.
Please help
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: stahta01 on April 11, 2013, 01:50:42 pm
Unfortunately it did not work for me.
ANy other tips that might work. I've done what you have said installed and tried other compilers.
Please help

http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler#Compiler-neutral_setup_steps (http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler#Compiler-neutral_setup_steps)

Tim S.
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: natedoggy on April 11, 2013, 10:59:57 pm
Thanks for the advice Tim S., but it still won't compile. It says that it is an environment error.
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: stahta01 on April 12, 2013, 05:31:52 am
Thanks for the advice Tim S., but it still won't compile. It says that it is an environment error.

Please post the path you entered for the toolchain?
Did you verify the path was valid?

Tim S.
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: natedoggy on April 19, 2013, 01:08:04 am
i dont know what you mean
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: SmittenJKitten on April 22, 2013, 05:07:10 pm
I had the same problem, and now i'm good to go.

Download this http://sourceforge.net/projects/mingw/?source=dlp
   That's the compiler that isn't actually there, you need to have it installed in order to use it.
When installing i checked the c++ option for when i eventually learn enough to move up to it.
   After installation is complete open CodeBlocks.
Go to settings>Compiler>ToolChainExecutables and click the auto-detect button, and it should now detect the compiler you have just installed.

   Hope this is to some use :) "This is all assuming you are using Windows btw"

For future readers, When you download codeblocks, the first two options do not download the compiler with it. The third 4th do.
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: srenac on October 09, 2013, 07:27:26 am
THIS really helped me. Beginner over here and this quickly fixed the problem. THANKS (:
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: nullne on October 10, 2013, 11:12:07 am
thanks ,though i do not know why
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: 22990atinesh on April 03, 2014, 11:41:54 am
I had a similar problem. Please note I'm a total n00b in C++ and IDE's but heres what I did (after some research)
So of course I downloaded the version that came with the compiler and it didn't work. Heres what I did:
1) go to settings in the upper part
2) click compiler
3) choose reset to defaults.

Hopefully this works  :-\

Kudos Bro Finally It worked for me too.
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: Uncreative on July 14, 2014, 11:27:05 am
I tried the first method suggested (restoring to defaults) and it didn't work. I think this was because there was no gnu gcc exe file. Then I tried the second method, downloading the compiler from online, and Code::Blocks did recognize the compiler, but when I tested the compiler on the default Hello World program, I got this error message:

-------------- Build: Debug in Starter project (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -fexceptions -g -pedantic -Wextra -Wall  -c "C:\Users\ALEX\Desktop\CodeBlocks\share\CodeBlocks\images\Projects\Starter project\main.cpp" -o obj\Debug\main.o
Execution of 'mingw32-g++.exe -Wall -fexceptions -g -pedantic -Wextra -Wall  -c "C:\Users\ALEX\Desktop\CodeBlocks\share\CodeBlocks\images\Projects\Starter project\main.cpp" -o obj\Debug\main.o' in 'C:\Users\ALEX\Desktop\CodeBlocks\share\CodeBlocks\images\Projects\Starter project' failed.

So, what now?
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: stahta01 on July 14, 2014, 04:32:48 pm
I tried the first method suggested (restoring to defaults) and it didn't work. I think this was because there was no gnu gcc exe file. Then I tried the second method, downloading the compiler from online, and Code::Blocks did recognize the compiler, but when I tested the compiler on the default Hello World program, I got this error message:

-------------- Build: Debug in Starter project (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -fexceptions -g -pedantic -Wextra -Wall  -c "C:\Users\ALEX\Desktop\CodeBlocks\share\CodeBlocks\images\Projects\Starter project\main.cpp" -o obj\Debug\main.o
Execution of 'mingw32-g++.exe -Wall -fexceptions -g -pedantic -Wextra -Wall  -c "C:\Users\ALEX\Desktop\CodeBlocks\share\CodeBlocks\images\Projects\Starter project\main.cpp" -o obj\Debug\main.o' in 'C:\Users\ALEX\Desktop\CodeBlocks\share\CodeBlocks\images\Projects\Starter project' failed.

So, what now?

I suggest NOT using space in paths while compiling with any MinGW GCC compiler.
Some can use them some can not.

I suggest NOT using C:\Users\ALEX\Desktop because the Windows security and antivirus are more likely to think it is a virus attack.

I also suggest starting a new thread since this one has nothing to do with your current problem.

I have tried to locate the problem in another thread http://forums.codeblocks.org/index.php/topic,19453.msg132925/topicseen.html#msg132925 (http://forums.codeblocks.org/index.php/topic,19453.msg132925/topicseen.html#msg132925)
Please read it and if your problem is still failed you can use that thread to ask for more help.

Tim S.
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: Cybermaze on August 09, 2014, 06:54:05 pm
I had the same problem.

Installing latest Code::Blocks 13.12 on Windows 8.1 with compiler, the program could not find the compiler.

Thank you laYahooz, your suggestion worked, now I can start programming :)
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: zakou3570 on September 29, 2014, 05:56:48 pm
I had a similar problem. Please note I'm a total n00b in C++ and IDE's but heres what I did (after some research)
So of course I downloaded the version that came with the compiler and it didn't work. Heres what I did:
1) go to settings in the upper part
2) click compiler
3) choose reset to defaults.

Hopefully this works  :-\


Donload  MinGW     Instaler from this link     http://www.mingw.org/category/wiki/download                up right corner is the button   run instaler exe then you need to open the program  and make update then check the base system packages  it wil be downloaded the instaled   then do the reset compiler thing other people say in this post you wil be fine   hope i helped
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: Holmz on October 02, 2014, 08:19:19 am
Similar issues on a mac (OSX10.9)

which icc says:
/usr/bin/icc

which fort says:
/usr/bin/ifort

The icc link in the code blocks says:
Scanning for lexers in /Applications/CodeBlocks.app/Contents/Resources/share/codeblocks/lexers/...
Found 46 lexers
...
Script plugin registered: Find Broken Files plugin
Script/function 'edit_startup_script.script' registered under menu '&Settings/-Edit startup script'
Current compiler 'Intel C/C++ Compiler' doesn't have correctly defined debugger!
Current compiler 'Intel C/C++ Compiler' doesn't have correctly defined debugger!
Current compiler 'Intel C/C++ Compiler' doesn't have correctly defined debugger!


And there seems to be only gfort (etc)... But no fort?
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: oBFusCATed on October 02, 2014, 09:20:39 pm
Are you able to build your project?
This message tells you that debugger won't work for  the ifort/icc compilers.
You should be able to build your projects just fine (if everything else is setup correctly).
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: Eezageeza on March 01, 2016, 07:02:36 am
Hello World!

I'm a total beginner and had an absolute nightmare trying to get Code Blocks to find and use a compiler. The information on the internet is rather inpenetrable and isn't always correct. It took a frustrating and disheartening effort to solve, at least enough for a beginner.

However, I solved my problem enough to practice coding!!   :D

This is what I did.

I reinstalled Code Blocks into my C: drive  (it was in D: previously, though I don't know if that made any difference or not)

I then went here:
https://sourceforge.net/projects/tdm-gcc/?source=typ_redirect
and downloaded TDM-GCC MinGW Compiler in the C: drive.

I then reloaded Code Blocks, settings >> compiler >> global compiler settings >> Tool Chain Executables Tab (to check the fields). The compiler was selected as GNU GCC Compiler. I then clicked "auto detect".

It FINALLY found the compiler.   :D :D :D :D

This is what worked for me after hours of fruitless searching and inpenetrable reading. The key I think in my case, was the TDM-GCC MinGW Compiler download. Now, I don't know if this is the real, useful deep way to begin a multimillion dollar systems development lifecycle, but it will do for practicing beginner code.
Perhaps looking at the tool chain executables may have been redundant, but I just said what I did.
I hope this may help any who remain frustrated.

Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: MortenMacFly on March 01, 2016, 08:47:35 am
I reinstalled Code Blocks into my C: drive  (it was in D: previously, though I don't know if that made any difference or not)
I then went here:
https://sourceforge.net/projects/tdm-gcc/?source=typ_redirect
Why didn't you simply install the version that has the compiler included? You should have read carefully the download page. Its written there.
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: jaitan on October 03, 2016, 03:34:07 pm
Probably the folder of the GNU compiler is in some other IDE that you have installed, search the files from your computer to the folder "MinGW"
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: Franexator on November 05, 2016, 02:07:58 pm
1)uninstall your codeblocks.
2) download the binary one named codeblocks-16.01mingw-setup.exe from here: https://sourceforge.net/projects/codeblocks/files/Binaries/16.01/Windows/codeblocks-16.01mingw-setup.exe/download
3) after installing the new codeblocks, go to settings>compiler and in the compiler flags, whlie you have choosen GNU GCC compiler, mark the second square (C++11).

Worked for me.
GL  :-\
Title: Re: can't find compiler executable in your search path (GNU GCC compiler)
Post by: rory on June 21, 2017, 01:38:14 am
Thanks pb, worked for me. appreciated.