caut_baia 9 Posting Whiz

Hi.I get the following error "g++: error: CreateProcess no such file or directory" whenever i try to compile a program.I have installed the MinGw 7.2 version at work on a windows machine and the problem does not occur , however after installing windows SP3 on my home computer i get this error and i just can't figure it out since i have set all the environment variables properly.I tried setting the path to "C:\MinGw\libexec\gcc\i686-mingw32\4.6.1" where cc1plus.exe and cc1.exe are located but still no luck.If i type this at the command line:

>_assoc .cpp=cpls
>_ftype cpls=g++ "%1" %*
>_program.cpp

it seemse to compile since i get compile time errors for the c++11 keywords which aren't recognized without the -std=c++0x switch.Any suggestions ? Thanks in advance.

Dani AI

Generated

Most likely cause: g++ is failing to spawn one of its helper programs (cc1plus, the assembler or linker) — Windows returns a CreateProcess failure when it can't create the child process. That usually comes from one of a few simple problems: the toolchain binaries aren't on PATH in the way g++ expects, a different g++ earlier in PATH is being called, an antivirus/UAC policy is blocking execution, or PATH entries are quoted/malformed. 's observation that launching the compiler via a file association produces regular compiler errors (not CreateProcess) shows g++ itself can run sometimes, but the driver can't always find or start its helpers.

Quick checks (run these in a cmd prompt):

where g++
g++ -v sample.cpp
g++ -print-file-name=cc1plus
echo %PATH%
"C:\MinGW\bin\g++" -v sample.cpp

What to look for in the verbose output: which g++ binary is being used, the exact path g++ tries to exec for cc1plus, and any "failed to exec" or permission errors. If g++ -print-file-name=cc1plus returns an empty path or a wrong location, g++ won't be able to spawn cc1plus.

Practical fixes that have resolved this error for many Windows users:

  • Put the MinGW "bin" directory (e.g. C:\MinGW\bin) on PATH and remove entries pointing only at internal libexec folders. Restart the shell after changing PATH.
  • Use where g++ to ensure there are no other conflicting installations earlier on PATH; remove or reorder duplicates.
  • Check antivirus/Windows Defender logs and temporarily disable or whitelist MinGW\bin and libexec directories — some AVs block cc1plus.
  • Avoid PATH entries wrapped in quotes or containing malformed characters; put simple paths (no parentheses/spaces) if possible.
  • If problems persist, reinstall a current MinGW/MinGW‑w64 distribution into a simple path (C:\MinGW or C:\mingw-w64) so the driver’s relative lookups match the actual layout.

The g++ verbose lines will pinpoint the exact helper that fails to start; once that path is corrected or whitelisted the CreateProcess failures disappear.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.