I am trying to set up the VScode with C++ Compiler Show and the problem I got is (By running the code with code runner)
and if I run with the debug option I got this problem
This is my "c_cpp_properties.json" { "configurations": [ { "name": "Win32", "intelliSenseMode": "clang-x64", "defines": [ "_DEBUG", "UNICODE", "__GNUC__=7", "__stdcall=attribute((stdcall))", "__cdecl=__attribute__((__cdecl__))", "__cplusplus=201703L" ], "includePath": [ "${workspaceFolder}/include", "C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++", "C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/x86_64-w64-mingw32", "C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/backward", "C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/include", "C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../include", "C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/include-fixed", "C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/include" ], "browse": { "path": [ "${workspaceFolder}/include", "C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++", "C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/x86_64-w64-mingw32", "C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/backward", "C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/include", "C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../include", "C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/include-fixed", "C:/MinGW64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/include" ], "limitSymbolsToIncludedHeaders": false, "databaseFilename": "" }, "cStandard": "c11", "cppStandard": "c++17" } ], "version": 4} This is my "launch.json" { "version": "0.2.0", "configurations": [ { "name": "Run C/C++", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/${fileBasenameNoExtension}.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": true, "MIMode": "gdb", "miDebuggerPath": "C:/MinGW64/bin/gdb.exe", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": false } ], "preLaunchTask": "build & run file" }, { "name": "Debug C/C++", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/${fileBasenameNoExtension}.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": true, "MIMode": "gdb", "miDebuggerPath": "C:/MinGW64/bin/gdb.exe", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": false } ], "preLaunchTask": "build & debug file" } ] }And this is my "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 } } ] }I just want to study C++ and I try a lot of way on the Internet for days and I still can't fix it Please help. The recommended development environment for C++ programming in CPTR 124 and CPTR 318 this semester is Microsoft's Visual Studio Code (VSCode). VSCode is available for free for Microsoft Windows, Apple macOS, and Linux. Many other fine C++ integrated development environments exist for these platforms, but each has its own peculiar way of configuring projects for editing, building, debugging, and executing C++ programs. The process of setting up a C++ project involving external libraries and other dependencies sometimes can become complicated, and it can be tedious to diagnose and correct configuration errors in a multitude of different development systems. Students using VSCode can be assured that they will receive timely support when things are not working as they should. VSCode is a programming editor coupled with a lightweight project management system. VSCode itself does include the tools necessary for compiling and debugging C++. You must install the C++ development tools (compiler, linker, and debugger) separately and then configure VSCode to use these tools. Fortunately, installing the C++ tools and VSCode and configuring everything to work for our purposes is relatively easy on Windows, macOS, and Linux. This document explains how to install and configure the necessary C++ development tools and VSCode on Windows, macOS, and Linux.
How do you fix G ++' is not recognized as an internal or external command operable program or batch file?After downloading, install MinGW and wait for the “MinGW Installation Manager” to show up.. When the “MinGW Installation Manager” shows up, click on mingw32-gcc-g++ then select “Mark for Installation”. In the menu at the top left corner, click on “Installation > Apply Changes”. Wait and allow to install completely.. How do I fix G + is not recognized as an internal?You need to set the environment PATH to include the directory of mingw's bin directory if you want o use gcc.exe or g++.exe in cmd . run 'path' or 'echo %PATH% in cmd.exe prompt.
Why G ++ is not recognized VS Code?If you don't see the expected output or g++ or gdb is not a recognized command, make sure your PATH entry matches the Mingw-w64 binary location where the compilers are located. If the compilers do not exist at that PATH entry, make sure you followed the instructions on the MSYS2 website to install Mingw-w64.
|