User forums > Help

Environment error

<< < (2/2)

MortenMacFly:

--- Quote from: Eboy on March 29, 2020, 06:02:05 pm ---https://drive.google.com/file/d/1PxLsIwLDUzidctBlrfRYpqiZMSbzdwoM/view?usp=sharing

--- End quote ---
Sorry for that, I didn't expect a PM on this and missed it.

So, from what I see in the video: C::B and the compiler are installed just fine. You need to do just one final step.

- Go to the compiler settings (Settings > Compiler)
- Switch to the tab "Toolchain executables"
- Try "Auto-detect"
- If that fails, select the path manually and browse/select your MinGW folder (sub-folder of C::B in your case, NOT the MinGW\bin folder!).
- Also, you may have to change the executable names under "toolchain executables" to gcc.exe, g++.exe (remove the "mingw32" prefix)

That should do it.

Next time, please continue to post in the forums. PM's are easily getting missed/ignored.

Edit: Added last bullet.

bonipk:
I am having same problem and nothing is working. Could it be the initial window defender message?

MortenMacFly:

--- Quote from: bonipk on March 30, 2020, 11:15:01 pm ---I am having same problem and nothing is working. Could it be the initial window defender message?

--- End quote ---
What Windows Defender message?
And what means "nothing is working"?

...and I missed one point:
- You may have to change the executable names under "tlolchain executables" to gcc.exe, g++.exe (remove the "mingw32" prefix).

takashi_85:
C:\MinGW/bin/gcc.exe should be C:\MinGW\bin\gcc.exe

Slashes are not valid in path strings in windows environment!! , this may have leaked from linux or Mac code !!.
As a temporary work around you can compile your code manually with command line  :-\ .
I confirm that i have the same problem with "codeblocks-20.03mingw-32bit-setup.exe" package under windows 7 32-bit.
Although it's a simple misconfiguration-or bug- but it's very nasty, as it prevents users from compiling "default template C++ code" after a fresh install !.

takashi_85:
I came down to this , i think this FixPathSeparators was called when it shouldn't be called!!. May be after compiler-->forceFwdSlashes was set to true for some reason.
Maybe C/C++ developers here can help!.

--- Code: ---void CompilerCommandGenerator::FixPathSeparators(Compiler* compiler, wxString& inAndOut)
{
    // replace path separators with forward slashes if needed by this compiler
    if (!compiler || !compiler->GetSwitches().forceFwdSlashes)
        return;

    size_t i = 0;
    while (i < inAndOut.Length())
    {
        if (inAndOut.GetChar(i) == _T('\\') &&
            (i == inAndOut.Length() - 1 || inAndOut.GetChar(i + 1) != _T(' ')))
        {
            inAndOut.SetChar(i, _T('/'));
        }
        ++i;
    }
}
--- End code ---

Navigation

[0] Message Index

[*] Previous page

Go to full version