Set Up C++ Development With Visual Studio Code on Windows 10 (VS Code)



In this video I am going to show, How to Set Up C++ Development With Visual Studio Code on Windows 10. We will use MinGW with VS code as our compiler and debugging tool. So First I will show How to install mingw. The we will see how to create, build and compile our first C++ Program on VScode.

With an updated VS Code you can do it in the following manner:

Hit (Ctrl+P) and type:

ext install cpptools
Open a folder (Ctrl+K & Ctrl+O) and create a new file inside the folder with the extension .cpp (ex: main.cpp):

Type in your code and hit save.

Press (Ctrl+Shift+P and type, Configure task runner and then select other at the bottom of the list.

{
“version”: “2.0.0”,
“tasks”: [
{
“label”: “build hello world”,
“type”: “shell”,
“command”: “g++”,
“args”: [
“-g”, “helloworld.cpp”
],
“group”: {
“kind”: “build”,
“isDefault”: true
}
}
]
}
Hit (Ctrl+Shift+B to run Build task. This will create the .obj and .exe files for the project.

For debugging the project, Hit F5 and select C++(Windows).

In launch.json file, edit the following line and save the file:
Below is an example using the MinGW GDB debugger:

{
“version”: “0.2.0”,
“configurations”: [
{
“name”: “(gdb) Launch”,
“type”: “cppdbg”,
“request”: “launch”,
“program”: “${workspaceFolder}/a.exe”,
“args”: [],
“stopAtEntry”: false,
“cwd”: “${workspaceFolder}”,
“environment”: [],
“externalConsole”: true,
“MIMode”: “gdb”,
“miDebuggerPath”: “C:\mingw\bin\gdb.exe”,
“setupCommands”: [
{
“description”: “Enable pretty-printing for gdb”,
“text”: “-enable-pretty-printing”,
“ignoreFailures”: true
}
],
“preLaunchTask”: “build hello world”
}
]
}

Hit F5.

★★★Top Online Courses From ProgrammingKnowledge ★★★
Python Programming Course ➡️ ⚫️
Java Programming Course ➡️ ⚫️
Bash Shell Scripting Course ➡️ ⚫️
Linux Command Line Tutorials ➡️ ⚫️
C Programming Course ➡️ ⚫️
C++ Programming Course ➡️ ⚫️
PHP Programming Course ➡️ ⚫️
Android Development Course ➡️ ⚫️
C# Programming Course ➡️ ⚫️
JavaFx Programming Course ➡️ ⚫️
NodeJs Programming Course ➡️ ⚫️
Jenkins Course For Developers and DevOps ➡️ ⚫️
Scala Programming Tutorial Course ➡️ ⚫️
Bootstrap Responsive Web Design Tutorial ➡️ ⚫️
MongoDB Tutorial Course ➡️ ⚫️
QT C++ GUI Tutorial For Beginners ➡️

★★★ Online Courses to learn ★★★
Get 2 FREE Months of Unlimited Classes from skillshare –
Data Science – |
Machine Learning – |
Artificial Intelligence – |
MERN Stack E-Degree Program – |
DevOps E-degree – |
Data Analytics with R – |
AWS Certification Training – |
Projects in Java – |
Machine Learning With TensorFlow – |
Angular 8 – Complete Essential Guide –
Kotlin Android Development Masterclass –
Learn iOS Programming Building Advance Projects –

★★★ Follow ★★★
My Website –

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!

Nguồn:https://baovnexpress.com/

  • Hands Down for you. ..amazing explanation

    anmol meda March 24, 2020 5:03 am Reply
  • thanks a lot

    new choice March 24, 2020 5:03 am Reply
  • When I run any program of c or c++ than in vs code then is always shows path related error

    santan kumar March 24, 2020 5:03 am Reply
  • Sir please help me I can't not run properly visual studio code

    santan kumar March 24, 2020 5:03 am Reply
  • you need to reboot windows in order to have g++ working

    Fab Files March 24, 2020 5:03 am Reply
  • When I type 'g++ –version; on command prompt, it shows:
    'g++' is not recognized as an internal or external command,

    operable program or batch file.

    Mahe Iram Khan March 24, 2020 5:03 am Reply
  • For beginners I would still suggest Eclipse for C/C++ developers as it has no such tedious process and if you are willing to spend some bucks CLion is the best by Jetbrains. Also Clion is free for students and there are plenty of other offers .

    Shibajyoti Majumder March 24, 2020 5:03 am Reply
  • 9:33 The green line dont appear to me

    Dan 213 March 24, 2020 5:03 am Reply
  • Online c++ compilers exist for beginner programmers. Just Google it

    Toto Matic March 24, 2020 5:03 am Reply
  • Thanks a lot!

    Rio March 24, 2020 5:03 am Reply
  • I followed the instruction to the letter and got an error in the command prompt where it couldn't find g++. Any advice?

    Returnality March 24, 2020 5:03 am Reply
  • Понял, VSCodом я пользоваться не буду))

    Vladimir OnFire March 24, 2020 5:03 am Reply
  • Thank you Rajesh Kuthrapali.

    Twisted March 24, 2020 5:03 am Reply
  • does this support c++17

    nishant jain March 24, 2020 5:03 am Reply
  • So every time I want to do something new, even a tiny code to play around with different things, I have to go through this entire process,
    just to make something work…….. If so then, this is extremely tedious and someone needs to rewrite a compiler that allows people to just
    get on the iDE write some small code if they want, and it will compile and execute without the person having to go through the motions of going through this entire process
    just to make something work.
    This is why I like JS-ES6. – Because if I have an idea, I just get on the IDE and code, and it will execute without me having to do a bunch of stuff. it just executes.

    TwstedTV March 24, 2020 5:03 am Reply
  • Боже, так медленно, затянуто, и произношение…

    Роман Кулага March 24, 2020 5:03 am Reply
  • download code runner extension instead. ez.

    Ravi Bhagat March 24, 2020 5:03 am Reply
  • Does it really have to be THIS long??

    Akshay Kiran Jose March 24, 2020 5:03 am Reply
  • Does anyone know if you can work with projects? In this case .. How do I set up to compile more than one program?

    I'm working on a college project and I'm having trouble linking the files because a file (main.cpp) is being compiled but the file.cpp is not.

    Gui Reis March 24, 2020 5:03 am Reply
  • What do i do if it shows up unable to start debug on min. 23:36?

    L U March 24, 2020 5:03 am Reply

Leave a Reply

Your email address will not be published. Required fields are marked *