Run C++ and C in Visual Studio Code | Mac and Windows!

  Рет қаралды 81,995

Caleb Curry

Caleb Curry

Күн бұрын

Start your software dev career - calcur.tech/dev-fundamentals Be notified of new C/C++ course: calcur.tech/c-cpp-newsletter
💯 FREE Courses (100+ hours) - calcur.tech/all-in-ones
Timestamps:
00:00 - Intro
02:18 - Compile on Mac
03:18 - Compile on Windows
05:18 - Running VS Code
07:35 - Code Runner Configuration
09:36 - C++11 and C++20 Compilation
⚛️ FREE React Course (20 hours) - calcur.tech/free-react-course
✅ Data Structures & Algorithms - calcur.tech/dsa-youtube
~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~
✉️ Newsletter - calcur.tech/newsletter
📸 Instagram - / calebcurry
🐦 Twitter - / calebcurry
🔗 LinkedIn - / calebcurry
▶️ Subscribe - calcur.tech/subscribe
👨🏻‍🎓 Courses - www.codebreakthrough.com
~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~
↪ My Amazon Store - www.amazon.com/shop/calebcurry
🅿 Patreon - calcur.tech/patreon-calebcurry
🅖 GitHub Sponsors - github.com/sponsors/CalebCurry
Ⓟ Paypal - paypal.me/calcur

Пікірлер: 75
@codebreakthrough
@codebreakthrough Жыл бұрын
Let me know if this video helped you! Be notified of new C/C++ course: calcur.tech/c-cpp-newsletter
@masternobody1896
@masternobody1896 Жыл бұрын
hey bro i became homeless cause inflation. please help what should i do
@tannerthorne6877
@tannerthorne6877 4 ай бұрын
Hey Caleb. I am running on Windows and ran into issues following the MinGW portion where we need to have access to g++ ---version. It may be helpful to add a CheatSheet for C/C++ Mastery Course buyers regarding the Windows portion. My comment below details the steps I had to follow.
@scottsher
@scottsher 5 ай бұрын
Thank you so much!!!! I spent the last 24 hours trying to get my VS code back to its original state after a CMAKE error. Can’t thank you enough. Just subscribed and liked your channel.
@PirateOfTheInternet_
@PirateOfTheInternet_ Жыл бұрын
It's good to see you back sir.
@alfonsocorvino-gq8dp
@alfonsocorvino-gq8dp 7 ай бұрын
You’ve just earned a sub, I was struggling with this for days (I just got started), appreciate your help !
@ee71aa
@ee71aa 9 ай бұрын
Caleb Curry you are a life saver brother, thank you so much for your very informative and helpfull videos God Bless you and I look forward to more of your coding courses. (The new one on C++)
@jatinbalchandani5799
@jatinbalchandani5799 11 ай бұрын
i watched 10 videos and yours finally helped
@gd_design
@gd_design Жыл бұрын
Thank you sooooo much for this video, you're a life saver!
@platoschauvet
@platoschauvet 3 ай бұрын
omfg I actually got it to work, thank you, dude!
@carborundum72
@carborundum72 Жыл бұрын
Thanks for the VS code videos. 👍 Something I wish I knew when I started coding is how easy it is to do version control and upload to github directly from within VS Code. Or how to create a cmake project from the command palette in order to compile my code on different platforms.
@tannerthorne6877
@tannerthorne6877 4 ай бұрын
Alright so just in case anyone got stuck like I did on the Windows portion. I followed the C++ installation guide on visual studio code. Make sure you add the environment variables for C:\msys64\ucrt64\bin to access g++ --version and gcc --version. Unfortunately gdb --version was not running in command terminal since it was a unknown command. According to the visual studio code website this is because some MinGW-w64 toolset packages are not installed. I was able to run the command 'pacman -S --needed base-devel mingw-w64-x86_64-toolchain' from the MSYS2 MINGW32 console. I then pressed enter to install all the packages. I then could add the path C:\msys64\mingw64\bin to my environment variables, since it was no longer empty. Hopes this helps anyone that gets stuck on windows with being unable to run gdb --version.
@Itzsubhashree07
@Itzsubhashree07 Жыл бұрын
Thanks for this video ❤️
@reeyacharniya7975
@reeyacharniya7975 4 ай бұрын
Thank You so much, I got how to setup VS Studio Code with the help of your video, ❤
@frankdearr2772
@frankdearr2772 2 ай бұрын
Great topic, thanks 👍
@programmercppjp
@programmercppjp 7 ай бұрын
bro thank you for this video you are my hero.
@Cris-fv7rp
@Cris-fv7rp Жыл бұрын
Hello Caleb your videos are very useful can you make a tutorial to run a multi file c++ program in vscode so that it can run the main file and other .cpp and .h files. Thank you!
@BillalBenzazoua
@BillalBenzazoua Жыл бұрын
thank you so much
@NPC_YOUTUBE_USER
@NPC_YOUTUBE_USER Жыл бұрын
thanx man a lot
@invincible._
@invincible._ 3 ай бұрын
thank you veeeeeeery much sir
@Devman113
@Devman113 9 ай бұрын
thank you
@steveavecillas1114
@steveavecillas1114 4 ай бұрын
How do you know if i am using c11 standard or c99 and same with c++ 11 or c++ 23
@longkesh1971
@longkesh1971 25 күн бұрын
Nice video.
@elektro-uu3mb
@elektro-uu3mb 11 ай бұрын
Hey, I've got a problem. I noticed that at 5:49, your dedicated task compiler was /usr/bin/g++ while mine is C:\msys64\mingw64\bin.exe( why is my different). Also for some reason the ./example for me it doesn't work. It just says this: The term './example' 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. Any tips/fixes?
@ertgg4th869
@ertgg4th869 8 ай бұрын
im with your brother, tell me if you solved the issue
@nons0chescrivere990
@nons0chescrivere990 7 ай бұрын
the ./example works only if your file name is example, so if your file is named 'randomcode' you need to write ./randomcode
@mattmccredy3530
@mattmccredy3530 7 ай бұрын
The default name for your executables will be "a.out" when running $ g++ ./file.c You can utilize the optional argument when compiling your c/c++ by adding "-o [alias]" So, in your terminal, instead of compiling a .c/.cpp file like so: $ g++ ./file.c where you'll get the "a.out" named executable, which can be ran like so: $ ./a.out -----> this will execute the programs living in the main function of your file.c program (I believe this is what you need to use as of your comment). You can provide an alias to your executable and run your files like so: $ g++ file.c -o ilovecats $ ./ilovecats -----> this is equivalent to running $ ./a.out, only you've provided a more suitable name. You can do this at any time, also. An executable can be deleted safely, just remember to create a new one by running $ g++ ./file.c Quick summary: running $ g++ ./file.c Will generate a default-named executable named "a.out" which you can run via "$ ./a.out" while in the working directory running $ g++ ./file.c -o ilovecats Will generate a custom-named executable named "ilovecats" which you can run via "$./ilovecats" while in the working directory Also, I used the .c file extension indicating the file to be a C file, not a C++, but for this example the two are interchangeable. Hope this helps and cheers for learning a low level language! You got this.
@CthulhuJon
@CthulhuJon 6 ай бұрын
Its probably because your cpp file is saved in a folder that is not the same folder that your terminal i running in. So in terminal, type ls to find where you are, then change directory using cd command, until you are in the same folder as your example.cpp file. Then ./example will work.
@marwaati9656
@marwaati9656 7 ай бұрын
why xcode won't be installed in my mac they tell me i have 13.5 version pls help
@slevinchrs
@slevinchrs 2 ай бұрын
can someone help with the where you have to enter the pacman -s command
@ptlh1969
@ptlh1969 5 ай бұрын
Anyone knew or can show a video on how to install and configure boost c++ libraries in Mac m1 / m2/ mx arm64? Tied cannot get it to work. :(
@Doova02
@Doova02 4 ай бұрын
When I type g++ it keeps telling me it's not recognized.. what am I doing wrong
@sudamlasi2007
@sudamlasi2007 8 ай бұрын
I can never get the run button! i use mac i am not sure what is the problem
@VedoVido
@VedoVido 10 ай бұрын
you cant open the msys2 if you have macbook. its the 8. video i watched and till now always problems.
@patrickbottiger2029
@patrickbottiger2029 2 ай бұрын
I'm probably not the first to point this out but. the path is wrong. if you follow VScodes example then the bind folder is sett to C:\msys64\ucrt64\bin by default. Other than that great video!
@Dexter101x
@Dexter101x 7 сағат бұрын
I'm not getting the GDB i.e. the debugger, I got the g++ and gcc
@faridoonnazari4135
@faridoonnazari4135 Жыл бұрын
In enviornment variables, while editing path, mine is not showing the (C:\msys64\mingw64\bin). Any tips please?
@nou1186
@nou1186 8 ай бұрын
It doesn’t show up for me either. :/
@ee71aa
@ee71aa 9 ай бұрын
Hi Caleb, even if I untick code runner - Run in terminal I still see no output under the output tab after rerunning it. also I get a notification saying that the .cpp app would like to access files in my desktop (that is where the folder containing the cpp files are). Can you help?
@ee71aa
@ee71aa 9 ай бұрын
Thanks Caleb ....I managed to get it to work following what you said and by simply double clicking on 'prettier' (another extension I have installed) and making sure 'code' is selected under the output tab. I hope this is helpful others.
@samuelng4509
@samuelng4509 3 ай бұрын
@@ee71aahi i am currently facing the same issue and when i run the code it says permission denied although i had given access to it…. Can u help me out
@mbicc
@mbicc Жыл бұрын
VS code has a c/cpp compile and run extension. It's much easier than code runner
@stevenm3914
@stevenm3914 10 ай бұрын
If only it actually worked. I can code no problems with visual studio but any time i try and make my simple helloworld.cpp and run on VS Code it instatly nopes me and thows the same bs error no matter what i try to do ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g++ : The term 'g++' 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 + g++ + ~~~ + CategoryInfo : ObjectNotFound: (g++:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ that is my error even after i add to path
@wolfx5499
@wolfx5499 6 ай бұрын
what I have no idea what this means ... I watched a video which said I would need "MinGW" to start coding .... is this still the case?
@afcmx
@afcmx Жыл бұрын
do java bro
@DreaminBig
@DreaminBig Жыл бұрын
hello.cpp:5:12: error: use of undeclared identifier 'O' return O; ^ 1 error generated. help please
@durzua07
@durzua07 11 ай бұрын
I think you want to return the number zero, 0, and not the letter O
@user-en7dl1lv6b
@user-en7dl1lv6b 3 ай бұрын
Visual Studio or vscode
@justinparker7902
@justinparker7902 9 ай бұрын
My Mac never starts the install. Could it be because I also code on xcode?
@saadkarim291
@saadkarim291 7 ай бұрын
the same probleme
@rtm-adot
@rtm-adot 5 ай бұрын
whenever I try to run any c++ code on vs it tells me the the launch.json file is not found
@Att7227
@Att7227 5 ай бұрын
Same for me
@rtm-adot
@rtm-adot 5 ай бұрын
@@Att7227 if you find a fix pls let me know
@Someone-zk9tb
@Someone-zk9tb 2 ай бұрын
did you find any solution?
@rtm-adot
@rtm-adot 2 ай бұрын
@@Someone-zk9tb nope sorry
@Someone-zk9tb
@Someone-zk9tb 2 ай бұрын
@@rtm-adot it’s good, tho I’ve found the solution :)
@Seeking_Solace
@Seeking_Solace 9 ай бұрын
Zero relevant links in the description. Commands aren't there to conveniently copy-paste. Zero responses in the comment section. There's absolutely no way your 564K subscribers are real people.
@MariosFinalAdventure
@MariosFinalAdventure 9 ай бұрын
ratio
@Hytension
@Hytension 9 ай бұрын
Thanks, my professor wanted me to use Visual Studio instead of VS Code. I don't even use Mac but idk visual studio looks so much worse than VS Code.
@mattmccredy3530
@mattmccredy3530 7 ай бұрын
I've recently transitioned to using VS on my windows laptop - although there's more windows/tools available, it's very easy to get used to! Coming from primarily writing code in VScode on a macbook.
@jagadeeshm5161
@jagadeeshm5161 3 ай бұрын
"Isn't there a command for compiling?"
@Sch0LarY
@Sch0LarY 16 күн бұрын
believe it or not it worked
@stevenm3914
@stevenm3914 10 ай бұрын
Man i keep getting issues g++ : The term 'g++' 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 + g++ + ~~~ + CategoryInfo : ObjectNotFound: (g++:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException i tried everything from all type of tutorial (seperatly) and still keep having issues. Even did a clean wipe of my drives and installed everything (Visual Studio and VS Code) and still have this issue Went into path and added mingw still nothing im really getting frustrated because when i run on visual studio i can run programs(not .exe)
@OhmyJeebuss
@OhmyJeebuss 10 ай бұрын
exact same problem
@blarze16
@blarze16 4 ай бұрын
yup me too
@gyaanpatra
@gyaanpatra 8 ай бұрын
❤❤❤❤❤❤
@sonnichjensen
@sonnichjensen Ай бұрын
DO YOU KNOW, that using a screen size larger that viewers of this video, simply makes everything fuzzy and render this video completely useless?
@codebreakthrough
@codebreakthrough Ай бұрын
Are you saying I need to zoom in? Did you try in full HD too? Def want to make the video usable so let me know how I need to improve that
@sonnichjensen
@sonnichjensen Ай бұрын
@@codebreakthrough full HD is too small text for my vision. Smaller screen size would be the right thing to do. I use max 1920 for width and only on a good screen, otherwise 1600 width with 125% text size
@newperson4889
@newperson4889 Жыл бұрын
You are a little too fast
@davidchibinda8484
@davidchibinda8484 3 ай бұрын
You are teaching yourself,u not showing us
@notabot8581
@notabot8581 2 ай бұрын
You’re black
Rust's Alien Data Types 👽 Box, Rc, Arc
11:54
Code to the Moon
Рет қаралды 134 М.
C# WPF Tutorial #4 - Code Behind
11:05
Kampa Plays
Рет қаралды 42 М.
Каха инструкция по шашлыку
01:00
К-Media
Рет қаралды 8 МЛН
A pack of chips with a surprise 🤣😍❤️ #demariki
00:14
Demariki
Рет қаралды 35 МЛН
WHY IS A CAR MORE EXPENSIVE THAN A GIRL?
00:37
Levsob
Рет қаралды 21 МЛН
Should you learn C++?? | Prime Reacts
20:29
ThePrimeTime
Рет қаралды 316 М.
C++ in VS Code: Building your Code with CMake
9:37
Visual Studio Code
Рет қаралды 12 М.
you will never ask about pointers again after watching this video
8:03
Low Level Learning
Рет қаралды 2 МЛН
macOS программы для программистов
9:05
Миша Ларченко
Рет қаралды 25 М.
Visual Studio Code C++ on Mac
12:33
Matt Whiting
Рет қаралды 1,5 М.
These 7 Coding Skills Give You an UNFAIR Advantage
7:55
Tech With Tim
Рет қаралды 506 М.
Setting up M2 MacBook Air For Programming
16:28
Andres Vidoza
Рет қаралды 1 МЛН
Smart Pointers in C++ (Stop Using new?)
17:18
Caleb Curry
Рет қаралды 10 М.
Learning C++ by making a Game... in 1 Week?!
10:14
Floky
Рет қаралды 353 М.
Жёсткий тест чехла Spigen Classic C1
0:56
Romancev768
Рет қаралды 713 М.
i like you subscriber ♥️♥️ #trending #iphone #apple #iphonefold
0:14
iPhone 15 Pro vs Samsung s24🤣 #shorts
0:10
Tech Tonics
Рет қаралды 13 МЛН