79684127

Date: 2025-06-29 23:42:51
Score: 3.5
Natty:
Report link

I faced a similar issue while following this VS Code Tutorial of Using GCC with MinGW.

When Clicked on "Run C/C++ file", it threw me the following error:

Executing task: C/C++: g++.exe build active file 
Starting build...
cmd /c chcp 65001>nul && C:\msys64\ucrt64\bin\g++.exe -fdiagnostics-color=always -g "C:\Users\Joy\Documents\VS CODE\programmes\helloworld.cpp" -o "C:\Users\Joy\Documents\VS CODE\programmes\helloworld.exe"
Build finished with error(s).
 *  The terminal process failed to launch (exit code: -1). 
 *  Terminal will be reused by tasks, press any key to close it. 

Also, there was this following pop - up error:
enter image description here

saying "The preLaunchTask 'C/C++: g++.exe build active file' terminated with exit code -1."

Here is my source code:

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main()
{
    vector<string> msg {"Hello", "C++", "World", "from", "VS Code", "and the C++ extension!"};

    for (const string& word : msg)
    {
        cout << word << " ";
    }
    cout << endl;
}

My USER Path Variables has- C:\msys64\ucrt64\bin

When I pass where g++ in my command prompt, i get C:\msys64\ucrt64\bin\g++.exe

Even I made sure it was EXACTLY how VS Code website said to do it. I have even uninstalled both MSYS2 and VS Code and then reinstalled them. But still, I am not encountering this error. Please help!

Reasons:
  • Blacklisted phrase (1): enter image description here
  • RegEx Blacklisted phrase (3): Please help
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Joy Khandelwal