I am trying to setup C++ to work on Visual Studio Code.
I am using minGW for the compiler and have setup MinGW properly in the default location C:\MinGW
.
Here is my c_cpp_properties.json
:
{
"configurations": [
{
"name": "Win32",
"includePath": ["${workspaceFolder}/**"],
"defines": ["_DEBUG", "UNICODE", "_UNICODE"],
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"$('workspaceRoot')",
"C:\\MinGW\\lib\\gcc\\mingw32\\8.2.0\\include\\c++",
"C:\\MinGW\\lib\\gcc\\mingw32\\8.2.0"
]
}
}
],
"version": 4
}
Here is my tasks.json
:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "C:/MinGW/bin/g++",
"args": [
"-g", "main.cpp"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Here is my settings.json
:
{
"files.associations": {
"iostream": "cpp"
}
}
When I try to build the solution, this message appears, despite of having a correct setup (atleast on the surface to a newbie):
> Executing task: C:/MinGW/bin/g++ -g main.cpp <
'C:\Users\Omkar' is not recognized as an internal or external command,
operable program or batch file.
D:\Projects\Tezi-Bois-Project\tezi-bois-hashcode>
Could someone please help me out with the setup and tell me where I am going wrong?
EDIT: I am trying to set up the environment using MinGW as my compiler, but I don't seem to find a solution on the thread provided as the answer nor is the comments useful. Any suggestions for the fix? My code isn't showing errors related to the compiler, its showing errors related to the location from where it's getting the file. The intellisense and the libraries are referred correctly and show appropriate errors.