0

I'm trying to compile a .cpp file with MinGW. Here are my steps:

  • I downloaded MinGW (latest release) and added "C:\MinGW\bin" to path
  • I navigate to the folder with my .cpp and header files
  • from there, I open windows powershell
  • I run g++ main.cpp

This seemingly completes without errors but I don't see a new .exe file appearing.

I checked the g++ version to make sure it is available and it is --> g++.exe (MinGW.org GCC-6.3.0-1) 6.3.0

I'm not sure what could be going wrong?

update: tried running it from terminal instead of powershell which gives--> cc1plus.exe Application Error: the application was unable to start correctly (0xc0000279) The same happens if I run terminal as administrator. Still no change when I introduce an error into the code.

Update 2: Updated to version 12.1.0, and now we're back to silently failing with no error

gmut
  • 7
  • 3
  • Just a guess, file/folder permissions? – Louis Go Jul 11 '22 at 09:25
  • Experiment, try putting a deliberate error in your main.cpp, compile again and see if you see the error reported. – john Jul 11 '22 at 09:33
  • Do you have a file called `a.exe` or `a.out`? You didn't specify an output file name, I think a.exe is the default. – john Jul 11 '22 at 09:35
  • @john, no files that have .exe or .out endings in this directory – gmut Jul 11 '22 at 09:39
  • Did you download it from Sourceforge? The compiled binary there is still broken, as per half a year back. – Lundin Jul 11 '22 at 09:41
  • Try to download from https://winlibs.com/ instead. In case that doesn't solve the problem then check out this: https://stackoverflow.com/questions/25124182/mingw-gcc-the-application-was-unable-to-start-correctly-0xc000007b – Lundin Jul 11 '22 at 09:45

1 Answers1

0

GCC 6.3.0 is very old. Looks like you used an old MinGW download. Instead you should download and install MinGW-w64. You can get a standalone version from https://winlibs.com/ or install MSYS2 and install MinGW-w64 via the package manager pacman.

The https://winlibs.com/ option is the easiest, as it requires no installation, just extract to a folder and start using it.

I also recommend uninstalling the old MinGW from C:\MinGW, or at least make sure this folder doesn't appear anywhere in the PATH environment variable, as to not get the different versions' DLLs mixed up.

Brecht Sanders
  • 6,215
  • 1
  • 16
  • 40