The reason the original intermediates folder is under the project is to avoid conflicts when building solutions that contain multiple projects. Across two projects you might have a source file that has the same name and these would produce the same intermediate targets. I like your folder organization and so with my multi-project solutions I use something like the following for the intermediate directory: $(SolutionDir)bin\intermediates\$(ProjectName)\$(Platform)\$(Configuration)\
Man, that was useful! I remember taking over a C++ project and I was endlessly going back and forth between these output directories, made all the more confusing as of course the solution and the project had the same name!
Thanks Cherno, still saving me years later after your game programming series that started my career! Coming now from a Unity/C# background, I want to get into C++ and I think I wanna leverage Visual Studio still just like I do with C#. This video really helped me on a practical level, that I otherwise don't know if I'd have found.
Funny, that's the first time I see someone not like the intermediate files belonging to a folder, but having all final ones copied into the main solution folder. This is especially useful for shared library projects that are used across many solutions, because VS can detect the intermediate files are updated even across other solutions and not recompile them.
You're wrong! These are the BEST damn C++ VS Settings EVER!!! I'm hyperventilating over these SETTINGS! On a serious note, I absolute love your style of teaching. Great explanation of the concepts with relevant programming examples. I'm hoping this semi-retired engineer can find programming work in the era of Covid-19 to support your channel. Cheers in 2021.
Great videos. Good C++ videos are hard to come by. Good C++ videos by English-native authors are almost unheard of. I know accents shouldn't matter that much, but something about yours makes it almost effortless to absorb the information. I personally prefer to store my intermediate files completely outside of my solution directory - into an almost temporary location, such as C:\Dev\ObjectFiles\$(ProjectName)\$(Configuration)\, etc. Primarily just to make it easier to do backups.
A bit of context why file structure is like that - the structure was made to ease the work of multi-solution gigantic codebases with .sln files often scattered around the filesystem while often reusing same projects. Goal was to reduce build time as much as possible (by keeping intermediates per project, so when you switch solution you can still use them), while still having separate output for each solution file. This kind of approach works quite well for applications the size of Windows, MS Office or Adobe Creative Suite, but often is overkill for anything smaller.
The videos are really helpful.. To the one's who know the basic OOP concepts of C++, but not sure about building projects, organizing into folders, setting the output/intermediated directories, how compiler and linker works, I say this videos are the best. I did'nt find any other source explaining better than this.
The Microsoft default build file organization is a bit weird if you are only working on one project. When you work with multiple projects in one solution it makes sense that you have the final executable in the solutions folder separate from the per project builds.
Visual Studio is indeed great for large projects. But for small things like doing examples and tutorials, I prefer to use VSCode, because I can build&debug any single file containing main() without the hassle of congratulating projects for each thing I wanna try.
Really great work! I watched a few of your tutorials and you are right on point every single time, simple, clear, straight to the point, no time wasted. Keep up the good work!
Cherno, do you ever realize that one day you started drinking coffee and never stopped again? In all seriousness, thanks for this series, I'm really hoping it will get me into programming once and for all; while I could make things a bit easier on myself by learning Python instead, I'd really just rather be able to program ALL things I make in C++ if necessary, from the ground up; even if I probably won't end up doing it that way. Your video "How to REALLY learn C++" is what inspired me to check out your playlist, so here's hoping.
I don't understand Microsoft's desire to create some silly 'virtual' folder system that doesn't even reflect the real thing. I mean, could they not work on something more practical, such as Git or a GUI create screen like they had in the old Visual C++ software?
Gotta say, for an existing project this was a pain to fix, but eventually got it. Next time will start using this method from the get go and hopefully shouldn't have any issues
I prefer to check the box that places my solution and project stuff altogether into a single directory. But, that's because I generally create solutions with a single project executable.
Because everything shown in this video works exactly the same in every single VS up to 22. This does not need an update yet and probably won't for quite a while.
This video is superb and a far better default directory layout. I can't express how many times I've went into the wrong Debug/Release directory.... very frustrating and wears on you over time.
It would be great if you did a series of videos on programming C++ code that provides functionality to a device of some sort (robotic or some output like a laser)?
It is so weird how important that stuff is. Sometimes for a new project just configuring all the settings will be like 20% of the work. You think you are ok at C++ but then you have to link all the libs, set up the project structure, set up tests, sometimes you have to recompile a lib from source because it was linked in a different way, all that stuff is almost as important as knowing the actual programming language. The enxt thing is of course if you work in a team, better make sure all those project files use macros and relative paths, otherwise your team members will check the project ot and realize they don't have a z:\\ drive and everything will break.
Thank you, Cherno! One more awesome lesson is overhere. :) The only weird thing, which I have spotted in this video is extra "\" after $(SolutionDir). I have paused the video, comment it here, but, after 20 seconds of video, you fix it. xD
@TheCherno about the intermediate objects being in the src dir and the excecutable in the outer folder...i honestly think makes sense...especially if you come from other languages. For exsmple in other languages the real executable are in the project root directory under a folder called build. They are not within source code file . While the other stuff like .obj are really still source code so it makes sense to NOT TO BE with the build exe
While waiting for the video to load I took a mouth full of coffee. As it started playing just basically had a moment there... #LoveYouProbablyMoreHomoThanICareToAdmit
I was drinking coffee while reading this comment and misread the first part as “while waiting for the video I took a load in the mouth”. Then I read the homo hashtag and realized we’re family! Lol
good man, man good, man. Oh man. Ohh man. Ohh man. Thank you very much for this folder explanation in this jungle IDE. Now looks obvious, but man, I'm been fighting with this thing forever and never occurs to me that IDE folder organization is based on tags. Already rover over the little icons in the interface to check out, milion times, but the thing is more complicated than a swiss wrist watch... so, i just don't touch to not break the whole thing (lol). Tks man.
Awesome, makes a lot of sense to configure the projects like you do. I don't really understand why so many IDE uses virtual folders.. Anyway, keep it up =)
After 7 Years this is still a very good explaination how to Setup Visual Studio. But is a similar setup for C++ also possible to do in Visual Studio Code?
Anyone having a problem with their Main.cpp NOT showing in their src folder after toggling to show all file view, simply go to File/Close Solution and then reopen the project, worked for me anyway.
Don't know if you've solved this, as it's been 6 months, but just in case you haven't: these settings are all solution-specific. If you want to re-use this "model" of organization, you have to turn it into a template. To do that, you have to go to the upper part of VS, and go to "Project > Export Template". There, you'll be prompted a few things. Select "Project Template", go "Next >". Name your template however you like, give it a description. I don't usually worry about the Icon Image, or Preview Image, and the Output location doesn't really matter either, as that's not where VS "pulls" templates from. (By default, it pulls it from a nearby folder called just "Templates", somewhere inside the C:\Users\{user}\ directory, if you are curious). Hope this helps. And if not you, somebody else. Cheers.
Thanks, there aren't many videos on IDE's, would love to see some more in-depth videos on how to use Visual Studio. There aren't a great deal of videos on how to use IDE's. I've found the IDE more complicated than C++ lol. Also in Visual Studio I think there's a bug which struggles with creating templates. They don't appear when creating a new project. I managed to do a workaround by installing the zipped template to C:\Users\YourUserName\Documents\Visual Studio 2010\Templates\ProjectTemplates then the file becomes visible. This has been acknowledged by Microsoft as a bug & is intended for fix in later development I believe (coming across other threads where this issue was raised) so hopefully this gets addressed soon.
when i can't sleep i watch his videos because these videos make me sleepy or something not in a bad way but i think because of the soothing music behind makes me sleepy so i never watched 3 videos in line and not sleep. :(
Hey Cherno, did you ever make a video on all the different file Visual Studio creates. You mentioned you will consider making a video on that on 2:10 to 3:00
this c++ series is awesome cherno ........ plzz dont stop making this , we really apreciate it
Patreon seems like a good way to make sure he doesn't ¯\_(ツ)_/¯
@The Illusionist True. Just build stuff while learning. Don't just learn learn learn.
BUILD
This whole C++ series deserves a lot more views. Thanks for the high quality :)
@Cherno if the Video extends to 30 min please keep it that way, I would be happy to listen to all of it.
@Lee Strongman Now its 3 years
@Lee Strongman now 4 year
@@AkariInsko now 6 years
The reason the original intermediates folder is under the project is to avoid conflicts when building solutions that contain multiple projects.
Across two projects you might have a source file that has the same name and these would produce the same intermediate targets. I like your folder organization and so with my multi-project solutions I use something like the following for the intermediate directory:
$(SolutionDir)bin\intermediates\$(ProjectName)\$(Platform)\$(Configuration)\
You really have talent in teaching or explaining something... this is gonna be my must-have channel...
Seriously the best C++ video tutorials on the internet! Keep up the great work Cherno!
Man, that was useful! I remember taking over a C++ project and I was endlessly going back and forth between these output directories, made all the more confusing as of course the solution and the project had the same name!
Thanks Cherno, still saving me years later after your game programming series that started my career!
Coming now from a Unity/C# background, I want to get into C++ and I think I wanna leverage Visual Studio still just like I do with C#.
This video really helped me on a practical level, that I otherwise don't know if I'd have found.
Funny, that's the first time I see someone not like the intermediate files belonging to a folder, but having all final ones copied into the main solution folder.
This is especially useful for shared library projects that are used across many solutions, because VS can detect the intermediate files are updated even across other solutions and not recompile them.
You're wrong! These are the BEST damn C++ VS Settings EVER!!! I'm hyperventilating over these SETTINGS! On a serious note, I absolute love your style of teaching. Great explanation of the concepts with relevant programming examples. I'm hoping this semi-retired engineer can find programming work in the era of Covid-19 to support your channel. Cheers in 2021.
This year is such a great year for Cherno, so much Quality! :D
This channel is going to be booming very soon
Love the c++ series
Great videos. Good C++ videos are hard to come by. Good C++ videos by English-native authors are almost unheard of. I know accents shouldn't matter that much, but something about yours makes it almost effortless to absorb the information. I personally prefer to store my intermediate files completely outside of my solution directory - into an almost temporary location, such as C:\Dev\ObjectFiles\$(ProjectName)\$(Configuration)\, etc. Primarily just to make it easier to do backups.
"really quick tip" - 12 minutes :D. Great series so far.
So many people are saying you deserve more subscribers but damn you deserve more subscribers
After exactly this first video I now want to watch your other videos
It's so helpful to understand wtf actually happen with the project
This series is just beyond comparison.
A bit of context why file structure is like that - the structure was made to ease the work of multi-solution gigantic codebases with .sln files often scattered around the filesystem while often reusing same projects. Goal was to reduce build time as much as possible (by keeping intermediates per project, so when you switch solution you can still use them), while still having separate output for each solution file. This kind of approach works quite well for applications the size of Windows, MS Office or Adobe Creative Suite, but often is overkill for anything smaller.
The videos are really helpful.. To the one's who know the basic OOP concepts of C++, but not sure about building projects, organizing into folders, setting the output/intermediated directories, how compiler and linker works, I say this videos are the best. I did'nt find any other source explaining better than this.
wow a video on a day that is not Sunday. I have not watched it yet but I know it is going to be good because it is you!
that was...SO helpful. I never understood how the damn thing works and what's with all these folders. thank you!
This removed so much confusion for me using VS. Thanks, mate!
Thanks, answered all my questions!
Amazing video, I'm just getting started with C++ and I was so confused about all this stuff until I watched your vid, thanks! ❤
Programmer: "A machine to turn caffeine into code."
- idk, someone
@SeppuKun you can't tell me what to do mom
Certainly a great serie videos for learn C++....thanks a lot for everything mister Cherno.
The Microsoft default build file organization is a bit weird if you are only working on one project. When you work with multiple projects in one solution it makes sense that you have the final executable in the solutions folder separate from the per project builds.
Thank you, this is realy going to make my life easier especially as a beginner
The most useful C++ related videos! Thanks!
cherno you are a legend.
Visual Studio is indeed great for large projects. But for small things like doing examples and tutorials, I prefer to use VSCode, because I can build&debug any single file containing main() without the hassle of congratulating projects for each thing I wanna try.
Output directory: $(SolutionDir)\bin\$(Platform)\$(Configuration)\
Not all heroes wear capes. Some wear trooper helmets papa bless
noooo: This is right: $(SolutionDir)bin\$(Platform)\$(Configuration)\ ===> one '\' has to be removed
Churno is just pumping out videos these days aye
Nice explanation... It has resolved my doubts related to the folder structure and why it is so.
Really great work! I watched a few of your tutorials and you are right on point every single time, simple, clear, straight to the point, no time wasted. Keep up the good work!
Cherno, do you ever realize that one day you started drinking coffee and never stopped again?
In all seriousness, thanks for this series, I'm really hoping it will get me into programming once and for all; while I could make things a bit easier on myself by learning Python instead, I'd really just rather be able to program ALL things I make in C++ if necessary, from the ground up; even if I probably won't end up doing it that way. Your video "How to REALLY learn C++" is what inspired me to check out your playlist, so here's hoping.
That coffee sip though :))
LoL, first I thought I left a comment on a video that I'm just about to view for the first time.
This video def helped a ton. Thanks.
omg thank you so much. Visual studio seems so foreign to me without being about to look at my folder structure.
I don't understand Microsoft's desire to create some silly 'virtual' folder system that doesn't even reflect the real thing. I mean, could they not work on something more practical, such as Git or a GUI create screen like they had in the old Visual C++ software?
I love your videos you are so funny and your way explaining is so amazing, your channel is one of the best channels continue like this brother
Thanks, I was searching speciffically for this video
Yeah but how do i use microsoft word
You can't use Microsoft Word to do programming
Pradyumn Kejriwal You can't use your brain to figure out sarcasm
quite rude tho :v
Well, you kinda should be able to, u can save files with .cpp format, get gcc and it should technically work, haven't tried it out tho.
Pradyumn Kejriwal You can, but it's way worse than VS
THANK YOU FOR YOUR TIMEEEEEEE BROOO Y R AWESOME!!! KEEP WITH THE C++ COURSE really really love it!
Well now! He also has to replace his blood with coffee. That is some fine coder material there! Love his vids!
Thanks for the tip. These Visual Studio videos are great!
Thanks man, these videos are so helpful!
Just had to pop in and say -- that is a freaking cool lamp.
I'm going to start setting up my projects this way because the organization is easier for me to look at.
Gotta say, for an existing project this was a pain to fix, but eventually got it. Next time will start using this method from the get go and hopefully shouldn't have any issues
Like the lamp!
I prefer to check the box that places my solution and project stuff altogether into a single directory. But, that's because I generally create solutions with a single project executable.
Love that BGM.
this vid need a 2021 update
2 years later and he didn't make an update video :(
Because everything shown in this video works exactly the same in every single VS up to 22. This does not need an update yet and probably won't for quite a while.
I started watching this series a few days ago and now I'm sad there's now more videos out yet, keep them coming
This video is superb and a far better default directory layout. I can't express how many times I've went into the wrong Debug/Release directory.... very frustrating and wears on you over time.
THANK YOU SO MUCH!!! Hate those default settings of vs.
This is useful for newbie like me , u r awesome dude
This series is amazing! Keep on going, thank you so much!!!
This guy is the best.
It would be great if you did a series of videos on programming C++ code that provides functionality to a device of some sort (robotic or some output like a laser)?
It is so weird how important that stuff is. Sometimes for a new project just configuring all the settings will be like 20% of the work. You think you are ok at C++ but then you have to link all the libs, set up the project structure, set up tests, sometimes you have to recompile a lib from source because it was linked in a different way, all that stuff is almost as important as knowing the actual programming language.
The enxt thing is of course if you work in a team, better make sure all those project files use macros and relative paths, otherwise your team members will check the project ot and realize they don't have a z:\\ drive and everything will break.
Oh my god
I had no idea how to organize my source folder using the file system directly in Visual Studio
Thank you, 2017 Cherno
I want to come back here in 10 years and be nostalgic
This is massively helpful, thank you
Thanks! It all makes sense now.
I was wondering am i weird to change those settings, i am glad i found other VS C++ programmers are also just like me
you solved half of my problem. thanks a lot.
Thank u verry much for such nice Content, i never seen such helpful Videos on RUclips :D amazing :D
Thank you, Cherno! One more awesome lesson is overhere. :)
The only weird thing, which I have spotted in this video is extra "\" after $(SolutionDir). I have paused the video, comment it here, but, after 20 seconds of video, you fix it. xD
@TheCherno about the intermediate objects being in the src dir and the excecutable in the outer folder...i honestly think makes sense...especially if you come from other languages. For exsmple in other languages the real executable are in the project root directory under a folder called build. They are not within source code file
.
While the other stuff like .obj are really still source code so it makes sense to NOT TO BE with the build exe
While waiting for the video to load I took a mouth full of coffee. As it started playing just basically had a moment there... #LoveYouProbablyMoreHomoThanICareToAdmit
I was drinking coffee while reading this comment and misread the first part as “while waiting for the video I took a load in the mouth”.
Then I read the homo hashtag and realized we’re family! Lol
Do you have to do this for each project you make?
Great video by the way!
The way you say "project" is weird.... I like it
This is really amazing and helpful one
Without your explanation, I would never have understood VS file management
good man, man good, man. Oh man. Ohh man. Ohh man. Thank you very much for this folder explanation in this jungle IDE. Now looks obvious, but man, I'm been fighting with this thing forever and never occurs to me that IDE folder organization is based on tags. Already rover over the little icons in the interface to check out, milion times, but the thing is more complicated than a swiss wrist watch... so, i just don't touch to not break the whole thing (lol). Tks man.
Awesome, makes a lot of sense to configure the projects like you do. I don't really understand why so many IDE uses virtual folders.. Anyway, keep it up =)
After 7 Years this is still a very good explaination how to Setup Visual Studio. But is a similar setup for C++ also possible to do in Visual Studio Code?
Thank you so much!! You saved my life
So much better. Thanks much.
How do you look so much younger only three years ago?
These last few years have been hell on all of us. lol
Anyone having a problem with their Main.cpp NOT showing in their src folder after toggling to show all file view, simply go to File/Close Solution and then reopen the project, worked for me anyway.
You are the Bomba amigo!
Great video. Short, informative, pleasant to watch. +1
*PROBLEM:* Always resets my output and intermediates directory after I close a solution...
Don't know if you've solved this, as it's been 6 months, but just in case you haven't:
these settings are all solution-specific. If you want to re-use this "model" of organization, you have to turn it into a template.
To do that, you have to go to the upper part of VS, and go to "Project > Export Template".
There, you'll be prompted a few things. Select "Project Template", go "Next >".
Name your template however you like, give it a description.
I don't usually worry about the Icon Image, or Preview Image, and the Output location doesn't really matter either, as that's not where VS "pulls" templates from. (By default, it pulls it from a nearby folder called just "Templates", somewhere inside the C:\Users\{user}\ directory, if you are curious).
Hope this helps. And if not you, somebody else. Cheers.
@@travisbennison9478 tnx mate , much appriciated .
Excellent teaching.
This vid need a 2024 update
Is it possible to save those changes so that they apply to all new projects as well?
Thanks, there aren't many videos on IDE's, would love to see some more in-depth videos on how to use Visual Studio. There aren't a great deal of videos on how to use IDE's. I've found the IDE more complicated than C++ lol.
Also in Visual Studio I think there's a bug which struggles with creating templates. They don't appear when creating a new project. I managed to do a workaround by installing the zipped template to C:\Users\YourUserName\Documents\Visual Studio 2010\Templates\ProjectTemplates
then the file becomes visible. This has been acknowledged by Microsoft as a bug & is intended for fix in later development I believe (coming across other threads where this issue was raised) so hopefully this gets addressed soon.
Concise & great content; thanks.
appreciate the effort ...very nice and informative video ..thankyou
Amazing, thanks for the tips. Great work!!
Cherno, u are the best
good tut,really apreciate it
when i can't sleep i watch his videos because these videos make me sleepy or something not in a bad way but i think because of the soothing music behind makes me sleepy so i never watched 3 videos in line and not sleep. :(
VERY VERY VERY USEFUL VIDEO!!!
Hey Cherno, did you ever make a video on all the different file Visual Studio creates. You mentioned you will consider making a video on that on 2:10 to 3:00
Love it.
Excellent setup.
Copied.
thanks, great help!
'Magister Maximvs'... Semper!