News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

codeblocks environment error

Started by John Voelkel, December 26, 2016, 03:52:32 PM

Previous topic - Next topic

John Voelkel

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

stahta01

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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

John Voelkel

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.

oBFusCATed

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!]

stahta01

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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

John Voelkel

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?

oBFusCATed

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!]

John Voelkel

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

stahta01

Quote from: stahta01 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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

John Voelkel

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

stahta01

#10
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

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

John Voelkel

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

oBFusCATed

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!]

Plati5

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.