0

I have recently installed VSC on my Win10 PC.

I was trying my first Hello world program in C++.

Building the program was successful.

#include<iostream>
using namespace std;

int main(){

    cout<<"Hello world!"<<endl;

    return 0;
}

Execution of the corresponding .exe file gave me the error 0xc000007b.

The interesting thing is that in the past I have installed minGW. Selecting that compiler today, no error appears and I can run the .exe file and see Hello world! displayed in the Windows console.

Today I have installed minGW-w64. As minGW it is in my C:\ disk.

If I write in the VSC console g++ --version I can read:

g++.exe (MinGW.org GCC Build-20200227-1) 9.2.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

No mention of minGW-w64.

In the compiler I can choose it though...

image

I have created an environment variable for my user C:\msys64\mingw64\bin in path, too.

Any ideas how to fix my problem?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Lucky-Luka
  • 13
  • 3
  • Does this answer your question? [MinGW / gcc: The application was unable to start correctly (0xc000007b)](https://stackoverflow.com/questions/25124182/mingw-gcc-the-application-was-unable-to-start-correctly-0xc000007b) – Peter - Reinstate Monica Feb 10 '22 at 20:31
  • Whatever mingw you use to build: Its bin directory must be in the PATH variable (as set by the system control panel/advanced/environment variables) because the program must load dlls residing there which Windows searches for along the PATH. – Peter - Reinstate Monica Feb 10 '22 at 20:32
  • I have created that environment variable (C:\msys64\mingw64\bin) in PATH both in the user and in the system. – Lucky-Luka Feb 10 '22 at 20:41
  • As you notice yourself, that does not appear to be the compiler VSC uses to compile ;-). – Peter - Reinstate Monica Feb 10 '22 at 20:45
  • HRESULT decoder [0xc000007b](https://james.darpinian.com/decoder/?q=0xc000007b). For future reference. – Eljay Feb 10 '22 at 21:30
  • what is the difference between user and system path variables? – Lucky-Luka Feb 11 '22 at 09:42

0 Answers0