mingw32-g++.exe: error: (invalid): No such file or directory

20,123

I'm going to assume from your above comment that the mingw toolchain you installed on your machine is working properly. The next thing you need to verify is that code::blocks is looking in the right place for that install.

To do this goto Settings->Compiler. This brings up the "Global compiler settings" window. Click on the "Toolchain executables" tab. You should see something like the following:

Toolchain executables

Check that the "Compiler's installation directory" has the correct path for your mingw install. Also check and make sure the various fields below point to the correct compiler executable name.

Share:
20,123
Tatsuyuki Ishi
Author by

Tatsuyuki Ishi

I'm a bored student, hunting for bleeding edge things everyday.

Updated on November 25, 2020

Comments

  • Tatsuyuki Ishi
    Tatsuyuki Ishi over 3 years

    --- Not a useful topic --- Problem occurred in project...

    I viewed this page: mingw32-g++.exe: error: CreateProcess: No such file or directory

    I installed MinGW(32) first, and installed MinGW64 (by mingw-builds). And this error occurred. I know i installed EGCS(64bit MinGW).

    I tried to uninstall(by wizard) and reboot but i still can't build in C::B.

    And i now uninstalled mingw(the original version) and installed TDM-GCC-32 and 64.

    The configure is not wrong, and the files is correct.

    My %Path%:

    PATH=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program File
    s (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Window
    s;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Progra
    m Files\Lenovo\Bluetooth Software\;C:\Program Files\Lenovo\Bluetooth Software\sy
    swow64;C:\Program Files (x86)\Windows Live\Shared;depot_tools;C:\Program Files (
    x86)\Common Files\Acronis\SnapAPI\;C:\Program Files\Microsoft SQL Server\110\Too
    ls\Binn\;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program File
    s (x86)\NArrange 0.2.9\;C:\TDM-GCC-64\bin;C:\TDM-GCC-32\bin
    
    • greatwolf
      greatwolf over 10 years
      do a test compile from the command prompt to verify the toolchain itself works. eg. g++ -Wall -pedantic example.cpp -o example.exe. Also, you have tdm-gcc 64bit and tdm-gcc 32bit on your path. Keep the one you want to use and remove the other.
    • Tatsuyuki Ishi
      Tatsuyuki Ishi over 10 years
      @greatwolf Thanks for the answer. I tried remove 64bit path and tried run "gcc" in cmd. gcc or g++ is working, but codeblocks is not working to build. It seems cannot find the compiler.
  • Tatsuyuki Ishi
    Tatsuyuki Ishi over 10 years
    I solved the problem! Tried in another project, and the build was successful. Thank you!
  • Admin
    Admin over 7 years
    You need o put -g in the base field, not the directory.