Тёмный

How to set up C++ in Visual Studio Code 

Kenny Yip Coding
Подписаться 24 тыс.
Просмотров 469 тыс.
50% 1

How to set up C++ with Visual Studio Code (vscode).
Install Visual Studio Code: code.visualstudio.com/
Install minGW (C++ Compiler): code.visualstudio.com/docs/cp...
Steps to setup minGW in windows:
1. Install MSYS2 using the link provided by microsoft github.com/msys2/msys2-instal...
2. Open MSYS2, enter the follow command:
pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain
3. Hit Enter for default selection, then type Y and hit Enter to proceed with the installation.
4. In your search bar, look for edit Environment Variables and open the setting. In the window bottom right, click Environment Variables. Click on Path in your list of User Variables. Click edit, new, add the following:
C:\msys64\ucrt64\bin
5. In your seach bar, look for Command Prompt and open it. Type in gcc --version, g++ --version, and gdb -- version. You should see minGW setup correctly.
Open vscode, and in extensions, look for C/C++ Extension Pack and install it. Then, create a new text file. Name it whatever you want, but be sure to include the .cpp extension.
Ex) Create a file named test.cpp and add some starter code. (include iostream, using namespace std, int main() ... cout "Hello World!")
On the top right, click on the play button to run your program. Select Run C/C++ File. You should now see your output display in the built-in terminal of VS Code!
And, there you have it! How to setup C++ for Visual Studio Code!
C++ Programming Playlist:
• C++ Programming Tutorial
Java Game Programming Projects Playlist:
• Java Game Programming ...
JavaScript Game Programming Projects Playlist:
• JavaScript Game Progra...
Subscribe for more coding tutorials 😄!

Опубликовано:

 

12 окт 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 485   
@fardinkhandaker3436
@fardinkhandaker3436 2 месяца назад
I've been looking for a video like this. I always struggle to compile but now, it's not a problem. Thank you!
@theironrhino110
@theironrhino110 3 месяца назад
Thanks a lot for the helpful guide! I know the steps are explained on the website but having someone to walk you through the process is a lot less stressful!
@ziprock
@ziprock 5 месяцев назад
i tried getting a compiler to work with vs code last year and couldn't figure it out and gave up. this method was super easy, straight to the point, and ive got a working compiler now thank you.
@shuaibakhtar5333
@shuaibakhtar5333 27 дней назад
brother, my compiler is still not working properly could you please help me
@franzilovesstem
@franzilovesstem 5 месяцев назад
incredibly greatful for such a nice simple put tutorial!!! Very straight to the point! love it, thanks a ton:D
@user-nc6ki5ts7x
@user-nc6ki5ts7x 4 месяца назад
Thank you. My cmd line test didnt work at 3:57 but it worked in the MYSYS2 cmd line. This solved my issue with not having a compiler.
@alexwade9888
@alexwade9888 4 месяца назад
The only video I could find that actually explained this clearly. Subscribed just off the quality of this video alone. As soon as I have hello worlded I'll be back to see what else you've got.
@gabrielapinheiro7643
@gabrielapinheiro7643 3 месяца назад
same here! all possibilities ! really well explained, well done man!!!
@Dulkage
@Dulkage 7 месяцев назад
The only tutorial that actually worked for me! Thank you!!
@thabomaleke874
@thabomaleke874 22 дня назад
The other ones 😞. They are really useless
@Dulkage
@Dulkage 22 дня назад
@@thabomaleke874 Yea
@user-kc1gp5mo7k
@user-kc1gp5mo7k 6 месяцев назад
Thanks very much. You really helped me a lot. Very simple and straight-to-the-point video. Thanks a lot once again.😊
@user-hx6xd7of4u
@user-hx6xd7of4u 4 месяца назад
This is so well-made, thank you!! Subscribed, keep up the good work
@yashwantchougale1600
@yashwantchougale1600 4 месяца назад
Thank you very much for uploading this to the point tutorial! I could get cpp running in one go :)
@Bruh-py5hk
@Bruh-py5hk 3 месяца назад
Thank you, I've been using online gdb for the longest, but just having the choice of vs code makes me happy. Make sure to restart the computer afterwards as well since it wasn't working until after.
@ahmadjan7029
@ahmadjan7029 4 месяца назад
I watched so many tutorials but this one worked thanks 😊😊
@ericroque5813
@ericroque5813 4 месяца назад
You dude is a hero! Let me add that the first time you run your code after you do this, there'll be a bunch of errors. Depending on how fast your computer is, it will take time before all the scripts load up and be read in your computer's system. Mine had a bunch of error at first when I ran my codes and I just restarted my laptop and it eventually worked.
@user-ey6op6qb1j
@user-ey6op6qb1j 4 месяца назад
the best video i have ever watched . you explained this in detail and clearly thank you.
@taongaphiri6084
@taongaphiri6084 7 месяцев назад
This never works for me. It's like the world doesn't want me using vs code for c++, I followed this tutorial step by step, watched the video three times, and it still failed.
@KennyYipCoding
@KennyYipCoding 7 месяцев назад
Which step are you failing at?
@farisraid7588
@farisraid7588 7 месяцев назад
@@KennyYipCoding last step is just not working something is wrong with the compiler or something i have no clue this is my 3rd vid so far
@zombz4291
@zombz4291 7 месяцев назад
@@KennyYipCoding same, when i run there's no "C/C++ :g++.exe build and debug active file"
@mink9390
@mink9390 6 месяцев назад
​@@KennyYipCoding yeah me too i try that for three times
@ZPlusiPlus
@ZPlusiPlus 6 месяцев назад
@@farisraid7588 Try restarting vs studio
@SiennaOfGalois
@SiennaOfGalois 28 дней назад
Such a helpful tutorial 👏 !!! I had initially installed an up-to-date msvc for my vscode as instructed but for whatever reason the compiler version would always default to 199707 (c++98) despite all the online tutorials I followed elsewhere and efforts I made trying to fix it. However, completely switching to minGW was amazing as everything got fixed and now my c++23 code runs flawlessly!
@andrewbauman256
@andrewbauman256 5 месяцев назад
Hey everyone if g++ or the other compilers aren't showing up at 06:08 time in the video or when you try to run the code (which is what happened to me every single time I tried this) this sounds so dumb but just make sure you did all the previous steps correct and RESTART YOUR COMPUTER. It worked for me after this. Thanks Kenny Yip Coding for the tutorial and happy coding y'all :)
@user-di8hh2pc4d
@user-di8hh2pc4d 4 месяца назад
my problem right here, life saver
@natepotate5025
@natepotate5025 3 месяца назад
ive been trying to fix this problem all day when all i had to do was restart my computer, thank you
@lionsin6067
@lionsin6067 3 месяца назад
your a life saver, its 5:35am and im so tired of trying to get this thing to work
@hime-kamisama
@hime-kamisama 3 месяца назад
You actually only need to close all VSCode windows so that the Path changes take effect.
@blasterchampions1801
@blasterchampions1801 3 месяца назад
Is there an error like this The preLaunchTask 'C/C++:gcc.exe build active file' terminated with exit code -1 ?
@HARIPRIYASRIPERAMBUDURU
@HARIPRIYASRIPERAMBUDURU 11 дней назад
I done installation within few minutes.I've been looking for a video like this.thanks a lot!!
@fenrisfish2800
@fenrisfish2800 5 месяцев назад
Fantastic tutorial, was searching through a few videos to get started on c++ and this one was the best
@zicraftian
@zicraftian 6 месяцев назад
helpful and to-the-point thanks for this!
@kasulejoseph9317
@kasulejoseph9317 27 дней назад
After 3 attempts, it worked out. Thanks for sharing
@dalyayosuf
@dalyayosuf 6 месяцев назад
Thankyou so much !! you've made it easier for me.
@kennethumis6907
@kennethumis6907 5 месяцев назад
I think you are a teacher. Life made easy. Thanks.
@justaguy1321
@justaguy1321 21 день назад
Thank you my friend, helped alot. All the best! 🙏
@atharvpal7038
@atharvpal7038 5 месяцев назад
Thanks man! Great video!
@abishekthayaanantham7157
@abishekthayaanantham7157 7 месяцев назад
It worked for me. Thanks :)
@shahadeissax
@shahadeissax 3 месяца назад
You saved me after 4 hrs of trying to run my code and facing problems thanks 😂
@abdou2523
@abdou2523 5 месяцев назад
I was so frustrated my code that worked perfectly fine in uni wouldn't work on my pc this is all I needed thank you
@DivijMahajan-uc2uy
@DivijMahajan-uc2uy 2 месяца назад
Worked in my case finally I am using vs code thankyou bro.
@rosesarered397
@rosesarered397 5 месяцев назад
Thanks! This was very helpful for me.
@RanaAhmed-el6wm
@RanaAhmed-el6wm 2 месяца назад
i can not even how I can thank you I got four hours trying to turn it on and I didn't know really really thank you .🥰🥰🥰💗💗💗
@sahi_beatz
@sahi_beatz 2 месяца назад
Thank you so much! Very Helpful!
@MoherZO
@MoherZO 4 месяца назад
Perfectly running after your tutorial thanks.
@mohamedboudrioua83
@mohamedboudrioua83 2 месяца назад
thanks men i really appreciate u giving such a detailed explanation video
@user-zf1er6ps9o
@user-zf1er6ps9o 4 месяца назад
Thx u Kenny! All Done!
@TheProgrammingPod
@TheProgrammingPod 2 месяца назад
Great and quick tutorial!
@douglasfox1522
@douglasfox1522 5 месяцев назад
The only tutorial that has actually worked! Thank you so much
@raisahib6746
@raisahib6746 7 месяцев назад
It really worked for me. Thanks 🙏 i have gone through many tutorials but this one only this worked❤
@KhadigaMater
@KhadigaMater 2 месяца назад
such a great and helpful video ! Thank you very much :)
@shubhamupadhyay3174
@shubhamupadhyay3174 8 месяцев назад
Thank you for your work
@inkydays37
@inkydays37 3 месяца назад
Appreciate the help.
@4n1r4
@4n1r4 2 месяца назад
Thank you so much! You saved my life 😁
@arunprabakar6891
@arunprabakar6891 2 месяца назад
Very well explained. Thank you for this wonderful video :)
@Takamitzu
@Takamitzu 3 месяца назад
Thnaks a lot Buddy that was a 10/10 helped me 1000%
@notbjeff732
@notbjeff732 2 месяца назад
You are such a goat for this thank you 🙏
@mauli1531
@mauli1531 2 месяца назад
Your tutorial is great, it realy helped me. 😀
@awenixmusic
@awenixmusic 7 месяцев назад
3:40 - For those who get the error "gcc is not recognized as an internal or external command", close the terminal and open the command prompt again but run as administrator.
@RamirezAnaMonicaS
@RamirezAnaMonicaS 7 месяцев назад
it still doesn't work
@himanshuadhikari3986
@himanshuadhikari3986 7 месяцев назад
it is just not working the only step where i am having issue is while doing that download in mysys2 as only 7 downloads turned successful out of 63
@vinamrajeet
@vinamrajeet 6 месяцев назад
Instead of pasting it on path of user variable, paste it on path of system variable
@user-kd4xu8eh5p
@user-kd4xu8eh5p 6 месяцев назад
thank you it worked after doing as u said@@vinamrajeet
@itsrainingafterall
@itsrainingafterall 6 месяцев назад
THIS WORKED TYSM
@KonnarakYahath
@KonnarakYahath 7 дней назад
Thank for this helpful video❤
@TOMAR2310
@TOMAR2310 3 месяца назад
The best so far...ty
@AUTTP911
@AUTTP911 2 месяца назад
THANK YOU, it finnaly works.
@roseleelauper514
@roseleelauper514 3 месяца назад
thank you! Do you have a tutorial to be able to compile C++20.? your instructions are easy to follow, ty! appreciate your videos!
@motivaon1348
@motivaon1348 3 месяца назад
At first I thought It didn't even after doing the steps correctly but the problem that I was encountering was at 06:08 the complilers rather than clicking the one with g++ I was instead clicking cpp.exe thanks for the help this almost took 1 week to figure out
@drohungauge6694
@drohungauge6694 3 месяца назад
Easy and simple. New sub
@Fetrah2
@Fetrah2 4 месяца назад
Thank you so much man
@study.ansh7405
@study.ansh7405 11 дней назад
thanku so much for the guide..it really helped! Also is there anyway to permanently select the compiler until we want? i mean it always asks to select the compiler every time u run the code (like u shown at the end of vid)...any solution for that?
@sktech414
@sktech414 2 месяца назад
thank you very much , I have subscribed to your channel
@vishalshinde-mq8rk
@vishalshinde-mq8rk 5 месяцев назад
best of luck for your future journey bro
@shrav.10
@shrav.10 5 месяцев назад
Great vid !
@cofishachou
@cofishachou День назад
Life saver man
@fedaasalah7557
@fedaasalah7557 5 месяцев назад
thanks it was really helpful
@comsocchannel
@comsocchannel 4 месяца назад
thank you so much... very clear tutorial..
@armanforouharfard2490
@armanforouharfard2490 Месяц назад
Hello Kenny, thanks for your video, i'm having a problem when i want to run my codes whenever i want to run it, it sends me into my terminal's output section and says "'scriptcs' is not recognized as an internal or external command, operable program or batch file." can you help with this?
@Amy_k7
@Amy_k7 4 месяца назад
As someone who is a complete beginner, THIS IS THE MOST USEFUL VIDEO I HAVE EVER COME ACROSS, THE ONLY VIDEO THAT HELPED. Thankyou so much honestly. 🔥
@froot_loops1274
@froot_loops1274 4 месяца назад
You are a lifesaver!!
@ahmedhassan5783
@ahmedhassan5783 8 месяцев назад
can you make a video for setting up C# in vscode? i had a problem with it requiring some sort of a subscription to the C# development kit extension
@gemechistesfaye82
@gemechistesfaye82 2 месяца назад
Thank you so much it works for me
@HarshAinchwar
@HarshAinchwar 2 месяца назад
It worked sir Thank you
@user-su2jd7pm6j
@user-su2jd7pm6j 4 месяца назад
Thank you very much, good luck.
@gokulnaathb2627
@gokulnaathb2627 4 месяца назад
Thank you so mcuh!
@syedshabbarraza7858
@syedshabbarraza7858 2 месяца назад
Thanks a lot brother it worked
@Ghghgh-tg7ye
@Ghghgh-tg7ye 4 месяца назад
Thanks it has worked.
@nguyenchihuy4915
@nguyenchihuy4915 Месяц назад
Thanks a lot!
@realjihadi7107
@realjihadi7107 5 месяцев назад
i surfed many videos and finally found this
@yehanjayakody3729
@yehanjayakody3729 Месяц назад
Thank You 🔥
@andresmorales5807
@andresmorales5807 4 месяца назад
I get an error that says: "cl.exe build and debug is only usable when VS Code is run from the Developer Command Prompt for VS."
@harshilbhardwaj3914
@harshilbhardwaj3914 6 месяцев назад
Thank You ❤️
@arkys1929
@arkys1929 4 месяца назад
I have one problem with VSCODE. When i run the code, an error appears "performing the preliminary task "C/C++: gcc.exe the build of the active file is " completed with exit code -1". in the "problems" is written package.json / You should not use the "*" activation, as it affects performance. How to solve this problem?
@muhammadinaammunir6761
@muhammadinaammunir6761 15 дней назад
Very nice 👍
@tvhwithGDF
@tvhwithGDF 2 месяца назад
this video makes ME STRESSED!
@negan9918
@negan9918 6 месяцев назад
Its helpful thank you
@kelpo3367
@kelpo3367 15 дней назад
omg thank you, I've always just used xcode on my MacBook but i wanted to use my PC but the vs tutorial didn't work.
@gokulanand.xl-a1lcmm367
@gokulanand.xl-a1lcmm367 2 месяца назад
In final step,Instead of c/c++ g++ debug, i have c/c++ gcc . I dont know how to change ??
@yashpandey7
@yashpandey7 Месяц назад
Thank You!!!!
@simplesadharan6112
@simplesadharan6112 Месяц назад
thanks it acutally works
@hajperito7470
@hajperito7470 3 месяца назад
I have a problem with launch.jackson please help
@noelmartinezpomares1765
@noelmartinezpomares1765 Месяц назад
great video, it works for me
@masfaisal6020
@masfaisal6020 3 месяца назад
thanks for info mister
@flickmew99
@flickmew99 6 месяцев назад
is that any way to hide that long blue colored line before the actual output?
@Misterbeast109countries
@Misterbeast109countries 2 месяца назад
yo thanks brah u the man
@qwertyt6479
@qwertyt6479 3 месяца назад
thank you, bro!
@user-gl3zg1cy3x
@user-gl3zg1cy3x Месяц назад
It works 💯💯💯
@calmado660
@calmado660 4 месяца назад
Much appreciated.
@user-tx1jz4fj4k
@user-tx1jz4fj4k 2 месяца назад
شكرا جزيلا لك اخي 😘❤
@7amkobarwari727
@7amkobarwari727 6 месяцев назад
Bro i done everything right but when i run code it’s telling me ( unable to find executable for (my username) can you help me what i need to do ?)
@shreyassupekar5243
@shreyassupekar5243 5 месяцев назад
I have tried it three times ...it is always failing at installing mys2 in that prompt.. it showing error in every gile after extracting that 58 files
@Stydent-uz6rl
@Stydent-uz6rl 4 месяца назад
I don't understand English very well, but I understand your language better than what is shown in my language. Thank you for your help.
@agustinehrman332
@agustinehrman332 3 месяца назад
Could you solve this issue? It happened to me as well...
@agustinehrman332
@agustinehrman332 3 месяца назад
Try selecting g++.exe when running instead of gcc.exe. That worked for me
@NatexDen
@NatexDen 2 месяца назад
Done i got, Thank you❤
@gulamnabikagathala3762
@gulamnabikagathala3762 8 месяцев назад
what about java and c++ both it is giving errer it is compiler with json the c file
@azumichaser5824
@azumichaser5824 5 месяцев назад
it shows cl.exe build and debug is only usable when VS Code is run from the Developer Command Prompt for VS. when i run the code, can someone help me?
@smilzolat
@smilzolat 4 месяца назад
Thanks Kenny
Далее
C++ Tutorial for Beginners - Learn C++ in 1 Hour
1:22:56
What Should Be Next? 👀🤯
00:56
Просмотров 7 млн
How I Did This INSANE Trick 🤯📱🍬
00:10
Просмотров 4 млн
Intro to C++ Programming
11:13
Просмотров 12 тыс.
Installing MinGW to build C++ Code on Windows
3:08
Просмотров 197 тыс.
How to get started with VS Code
17:48
Просмотров 33 тыс.
Compiling & Executing C++ Programs (VS Code)
13:42
Просмотров 243 тыс.
Using Modern OpenGL in C++
18:21
Просмотров 415 тыс.
How C++ Works
20:21
Просмотров 1 млн
What Should Be Next? 👀🤯
00:56
Просмотров 7 млн