The closest similar answer I found for it is here
But that doesn't contain an answer to my question. I also went through the docs for trying to have C++ support to VSCode. I didn't find OSX specific settings and I am not well versed with such configurations. Could someone please help ?
Update:
Adding the contents of tasks.json, launch.json, c_cpp_properties.json, and terminal output for more clarity:
tasks.json:
{
"version": "2.0.0",
"tasks": [
  {
    "label": "build & debug file",
    "type": "shell",
    "command": "g++",
    "args": [
      "-g",
      "-o",
      "${fileBasenameNoExtension}",
      "${file}"
    ],
    "group": {
      "kind": "build",
      "isDefault": true
    }
  },
  {
    "label": "build & run file",
    "type": "shell",
    "command": "g++",
    "args": [
      "-o",
      "${fileBasenameNoExtension}",
      "${file}"
    ],
    "group": {
      "kind": "build",
      "isDefault": true
    },
    "problemMatcher": []
  }
]
}
launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
    {
        "name": "(lldb) Launch",
        "type": "cppdbg",
        "request": "launch",
        "program": "${workspaceFolder}/test",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}",
        "environment": [],
        "externalConsole": true,
        "MIMode": "lldb"
    }
]
}
c_cpp_properties.json:
{
"configurations": [
    {
        "name": "Mac",
        "includePath": [
            "${workspaceFolder}/**",
            "/usr/local/Cellar/gcc/7.1.0/include/c++/7.1.0",
            "/usr/include/c++/4.2.1"
        ],
        "defines": [],
        "macFrameworkPath": [
            "/System/Library/Frameworks",
            "/Library/Frameworks"
        ],
        "compilerPath": "/usr/bin/clang",
        "cStandard": "c11",
        "cppStandard": "c++17",
        "intelliSenseMode": "clang-x64"
    }
],
"version": 4 }
Current problem I am facing with this configuration is that I get the following error when I try: Terminal-> Run Build Task-> build & debug file:
    ld: warning: ignoring file /Users/xyz/Workspace/VSCode/.vscode/tasks.json, file was built for unsupported file format ( 0x7B 0x0A 0x20 0x20 0x20 0x20 0x22 0x76 0x65 0x72 0x73 0x69 0x6F 0x6E 0x22 0x3A ) which is not the architecture being linked (x86_64): /Users/xyz/Workspace/VSCode/.vscode/tasks.json
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The terminal process terminated with exit code: 1
 
    