Author Topic: codeblocks environment error  (Read 28960 times)

Offline John Voelkel

  • Multiple posting newcomer
  • *
  • Posts: 10
codeblocks environment error
« on: December 26, 2016, 03:52:32 pm »
CodeBlocks  I am 84 new to all this.  Please help  I hope I am posting at the correct spot.
When I installed CodeBlocks over a month ago it worked good.  Then it suddenly began to give trouble and I did not work.  The program started up but I get a note that says:
   "Envioument error, Can't find compiler executable in your configured search                       path for GNU GCC"
When I go to Settings>compiler>toolchain
I see selected compiler:  GNU GCC compiler
compiler installation directory C:\MinGW
Could not auto-detct compiler GNU GCC
NOTE: All programs must exist in the "bin" sub-directory of this path or any of the "additional" paths
I have uninstalled CodeBlocks 16.-01 and installed it again hoping to help but I still get the same message about the above "Environment error".
I am trying to get ready for an online C++ course that begins January 18
I am not very computer savy and at 84 am trying to keep my brain active.  I need step by step help.  I have tried the segustions for my Google search.  Please help

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: codeblocks environment error
« Reply #1 on: December 26, 2016, 04:16:26 pm »
Install a Compiler!
Or install Code::Blocks IDE that ships with a Compiler. It has mingw in its filename.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline John Voelkel

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: codeblocks environment error
« Reply #2 on: December 26, 2016, 04:52:54 pm »
Thanks for the reply.  I thought I did install CodeBlocks with the compiler GNU GCC.
When I go to settings>compiler it shows GNU GCC as the compiler.  Uninstalling and reinstalling has hot changed things.  What surprises me is that my original install worked for a while and I was able
to compile files shown in the book I bought "Teach Yourself C++" from Sams. The things for me to
repair are things I don't know where to begin.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: codeblocks environment error
« Reply #3 on: December 26, 2016, 05:09:39 pm »
Goto the toolchain executables tab of this GCC compiler and see what executables and where C::B tries to execute.
Then go to this folder and see if the executables are still there.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: codeblocks environment error
« Reply #4 on: December 26, 2016, 09:10:05 pm »
Do you know what a filename is?

If yes, what was the filename of the CB exe you installed?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline John Voelkel

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: codeblocks environment error
« Reply #5 on: December 26, 2016, 09:41:22 pm »
at toolchain I see C:\MinGW  at C++ compiler it shows mingw-get.exe

I think I know what a file is but I am not sure where the filename is of the CB exe I installed.
Can I just do a search for it?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: codeblocks environment error
« Reply #6 on: December 26, 2016, 09:51:22 pm »
mingw-get.exe is not a compiler, but the installer for the mingw as far as I know.
The compilers are named something like mingw-gcc.exe mingw-g++.exe.
Pressing the auto detect button might fix things if the compiler is really installed and available.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline John Voelkel

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: codeblocks environment error
« Reply #7 on: December 26, 2016, 10:16:11 pm »
goto "Settings->Compiler...->Global compiler settings->GNU GCC Compiler->Toolchain executables" and fix the compiler's setup.
Skipping...
Nothing to be done (all items are up-to-date).
This is the message in the section "logs & others"
I will look for the compiler you list.  When I press the auto detect is says it cant find
the compiler  it says "could not auto detect installation path for GNU GCC compiler

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: codeblocks environment error
« Reply #8 on: December 26, 2016, 11:14:48 pm »
Install a Compiler!
Or install Code::Blocks IDE that ships with a Compiler. It has mingw in its filename.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline John Voelkel

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: codeblocks environment error
« Reply #9 on: December 27, 2016, 01:36:28 pm »
Thanks Tim, I have on my desktop an icon "MinGW" installer.  I have tried many things and think I did install that but will try again.  My problem seemed to start after I installed Visual Studio so I uninstalled it, all 104 megs.  I am surprised that CB worked after I first installed it for several weeks.  Now, after uninstalling CB and after removal of Visual Studio and then reinstalling CB just like before it still gives me the Environment error.  What is a name for a Code::Blocks IDE with mingw in its file name?
I am going to take a C++ online course and am trying to get ready.  John Voelkel

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: codeblocks environment error
« Reply #10 on: December 27, 2016, 06:57:03 pm »
The file codeblocks-16.01mingw-setup.exe contains Code::Blocks and MinGW Installer.
NOTE: An installer needs to be ran after downloading it.

Tim S.

http://sourceforge.net/projects/codeblocks/files/Binaries/16.01/Windows/codeblocks-16.01mingw-setup.exe

or

http://www.fosshub.com/Code-Blocks.html/codeblocks-16.01mingw-setup.exe

« Last Edit: December 27, 2016, 06:59:25 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline John Voelkel

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: codeblocks environment error
« Reply #11 on: December 28, 2016, 03:02:34 pm »
Tim,
I think I have downloaded and run all the things people have said for me to do.
The message I get via pop up is " Environment error:  Can't find compiler executable in your configured search path for GNU GCC compiler.  What I need is info on how to correct the search path.  I installed the GNU GCC compiler but need to know how to change the search path to it.

John

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: codeblocks environment error
« Reply #12 on: December 28, 2016, 03:37:42 pm »
Some steps
1.verify that the compiler executables run.
1a. To do so open a command promp (cmd.exe)
1b. go to the folder of your compiler (cd <somepath>)
1c. type the name of the executable mingw-gcc.exe --version
1d. if you see a version info printed then all is fine
2. fix settings
2a. open compiler settings
2b. select the proper compiler you want to edit
2c. select the toolchain tab
2d. verify the path is correct (without the bin extension as advised)
2e. verify the executable names are correct
2f. press the ok button and try to compile your project again

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Plati5

  • Single posting newcomer
  • *
  • Posts: 2
Re: codeblocks environment error
« Reply #13 on: January 18, 2017, 07:17:37 pm »
I had the same problem (at least your description fits the problem I had)  but finally I solved it:

I found out that Code::blocks assumes that the C compiler is called mingw-gcc.exe  but in my installation it is just called gcc.exe
Same was true for the C++ compiler: it is not mingw-g++.exe  but just g++.exe


I simply renamed the files in Settings>Compiler>Toolchain executables  and everything started working.

May be it's the same with your installation of mingw.