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.
Great video. I spent about 3 hours trying to get MinGW installed on my windows PC and with this vid I was compiling the same code on my mac in about 2 minutes. My main computer is a mac. Thank you!
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.
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.
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?
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.
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.
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++)
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!
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.
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!
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?
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.
@@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
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.
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
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)
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.
@@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
Let me know if this video helped you!
Be notified of new C/C++ course: calcur.tech/c-cpp-newsletter
hey bro i became homeless cause inflation. please help what should i do
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.
Many people are complaining but I've watched so many tutorials and this is the first one that helped me so thanks my g.
It's good to see you back sir.
Great video. I spent about 3 hours trying to get MinGW installed on my windows PC and with this vid I was compiling the same code on my mac in about 2 minutes. My main computer is a mac.
Thank you!
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.
c++ is easier than visual code
can not understand how to use it
Afte adding C:\msys64\mingw64\bin this path. Should i delete C:\msys64\ucrt64\bin this path from environment variables
@@Goutham.070 on a cruise I’ll take a look at this when I get back
@@tannerthorne6877still on that cruise lol
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.
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?
im with your brother, tell me if you solved the issue
the ./example works only if your file name is example, so if your file is named 'randomcode' you need to write ./randomcode
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.
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.
@@CthulhuJon This works
You’ve just earned a sub, I was struggling with this for days (I just got started), appreciate your help !
i watched 10 videos and yours finally helped
omfg I actually got it to work, thank you, dude!
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++)
bro thank you for this video you are my hero.
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!
I love you bro 😘 I am trying to do this
fix for last 3 days. thank you 🙏
Thank You so much, I got how to setup VS Studio Code with the help of your video, ❤
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.
Thank you sooooo much for this video, you're a life saver!
Thanks for this video ❤️
Great topic, thanks 👍
using the terminal is the only way to handle user input right? If it is assigned to output then you can't do anything with user input correct?
Thank you really from my heart. Thank you ❤
How do you know if i am using c11 standard or c99 and same with c++ 11 or c++ 23
thank you veeeeeeery much sir
I was getting extremely frustrated. Thank you for the enlightenment boss!
whenever I try to run any c++ code on vs it tells me the the launch.json file is not found
Same for me
@@Att7227 if you find a fix pls let me know
did you find any solution?
@@Someone-zk9tb nope sorry
@@calculatedrisks7 it’s good, tho I’ve found the solution :)
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!
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?
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.
@@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
can someone help with the where you have to enter the pacman -s command
In enviornment variables, while editing path, mine is not showing the (C:\msys64\mingw64\bin). Any tips please?
It doesn’t show up for me either. :/
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.
ratio
VS code has a c/cpp compile and run extension. It's much easier than code runner
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
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?
Thank you!! 🙏🏿 😅😅
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. :(
I'm not getting the GDB i.e. the debugger, I got the g++ and gcc
why xcode won't be installed in my mac they tell me i have 13.5 version pls help
the output or the "hellow world" aint on the debug console, it aint anywhere actually
When I type g++ it keeps telling me it's not recognized.. what am I doing wrong
thank you so much
I can never get the run button! i use mac i am not sure what is the problem
you cant open the msys2 if you have macbook. its the 8. video i watched and till now always problems.
thanx man a lot
My Mac never starts the install. Could it be because I also code on xcode?
the same probleme
Nice video.
"Isn't there a command for compiling?"
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)
exact same problem
yup me too
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.
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.
thank you
iostream does not work for me
Visual Studio or vscode
Cannot build and debug because the active file is not a C or C++ source file. ?
do java bro
believe it or not it worked
DO YOU KNOW, that using a screen size larger that viewers of this video, simply makes everything fuzzy and render this video completely useless?
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
@@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
You are a little too fast
I think he has a Indian surname but looks White.
❤❤❤❤❤❤
You are teaching yourself,u not showing us
You’re black
hello.cpp:5:12: error: use of undeclared identifier 'O'
return O;
^
1 error generated.
help please
I think you want to return the number zero, 0, and not the letter O