How to debug and run c++ in vs code

Viewed 379

I have even checked my environment variables path its correct, tried uninstalling vs code many times same, issue everytime i i get output

C/MingW/bin/g++.exe : The term '/C/MingW/bin/g++.exe' is not recognized as the name of a cmdlet, function, script file, or operable 

program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • /C/MingW/bin/g++.exe -g 'c:\Users\sayye\Dropbox\My PC (LAPTOP-T1S5QOV ...
  •   + CategoryInfo          : ObjectNotFound: (/C/MingW/bin/g++.exe:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    

my c_cpp_properties.json

{
  "configurations": [
    {
      "name": "windows-gcc-x86",
      "includePath": [
        "${workspaceFolder}/**"
      ],
      "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE"
      ],
      "compilerPath": "gcc",
      "cStandard": "${default}",
      "cppStandard": "${default}",
      "intelliSenseMode": "windows-gcc-x86",
      "compilerArgs": [
        "-Wall",
        "-Wextra",
        "-Wpedantic"
      ]
    }
  ],
  "version": 4
}

launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "g++.exe - Build and debug active file",
      "type": "cppdbg",
      "request": "launch",
      "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
      "args": [],
      "stopAtEntry": false,
      "cwd": "${workspaceFolder}",
      "environment": [],
      "externalConsole": false,
      "MIMode": "gdb",
      "miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe",
      "setupCommands": [
        {
          "description": "Enable pretty-printing for gdb",
          "text": "-enable-pretty-printing",
          "ignoreFailures": true
        }
      ],
      "preLaunchTask": "C/C++: g++.exe build active file"
    },
    {
      "name": "C/C++ Runner: Debug Session",
      "type": "cppdbg",
      "request": "launch",
      "args": [],
      "stopAtEntry": false,
      "cwd": "c:\\Users\\sayye\\Dropbox\\My PC (LAPTOP-T1S5QOVG)\\Desktop\\Dump_codes\\c++",
      "environment": [],
      "program": "c:\\Users\\sayye\\Dropbox\\My PC (LAPTOP-T1S5QOVG)\\Desktop\\Dump_codes\\c++\\build\\Debug\\outDebug",
      "internalConsoleOptions": "openOnSessionStart",
      "MIMode": "gdb",
      "miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe",
      "externalConsole": false,
      "setupCommands": [
        {
          "description": "Enable pretty-printing for gdb",
          "text": "-enable-pretty-printing",
          "ignoreFailures": true
        }
      ]
    }
  ]
}

Task.json

{
  "tasks": [
      {
          "type": "shell",
          "label": "C/C++: g++.exe build active file",
          "command": "C:/MingW/bin/g++.exe",
          "args": [
              "-g",
              "${file}",
              "-o",
              "${fileDirname}\\${fileBasenameNoExtension}.exe"
          ],
          "options": {
              "cwd": "${workspaceFolder}"
          },
          "problemMatcher": [
              "$gcc"
          ],
          "group": {
              "kind": "build",
              "isDefault": true
          }
      }
  ],
  "version": "2.0.0"
}

setting.json

{
  "files.associations": {
    "iostream": "cpp"
  },
  "C_Cpp.errorSquiggles": "Disabled",
  "C_Cpp_Runner.cCompilerPath": "gcc",
  "C_Cpp_Runner.cppCompilerPath": "C:\\MinGW\\bin\\g++.exe",
  "C_Cpp_Runner.debuggerPath": "C:\\MinGW\\bin\\gdb.exe",
  "C_Cpp_Runner.makePath": "C:\\MinGW\\bin\\make.exe",
  "C_Cpp_Runner.warnings": [
    "-Wall",
    "-Wextra",
    "-Wpedantic"
  ],
  "C_Cpp_Runner.compilerArgs": [],
  "C_Cpp_Runner.includePaths": [],
  "C_Cpp_Runner.linkerArgs": [],
  "C_Cpp_Runner.cStandard": "",
  "C_Cpp_Runner.cppStandard": "",
  "C_Cpp_Runner.excludeSearch": [],
  "C_Cpp_Runner.enableWarnings": true,
  "C_Cpp_Runner.warningsAsError": false
}

I want to get my output in vs code integrated terminal

0 Answers
Related