How to Properly Setup C++ Projects

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 พ.ค. 2024
  • To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/TheCherno. The first 200 of you will get 20% off Brilliant’s annual premium subscription!
    Patreon ► / thecherno
    Instagram ► / thecherno
    Twitter ► / thecherno
    Discord ► / discord
    Project Template ► github.com/TheCherno/ProjectT...
    Premake documentation ► premake.github.io/docs/
    Hazel ► hazelengine.com
    🕹️ Play our latest game FREE (made in Hazel!) ► studiocherno.itch.io/dichotomy
    🌏 Need web hosting? ► hostinger.com/cherno
    📚 CHAPTERS
    0:00 - C++ project architecture
    5:10 - My C++ project template
    10:55 - Applying this setup to an existing project
    27:00 - Problems
    29:44 - Regret
    💰 Links to stuff I use:
    ⌨ Keyboard ► geni.us/T2J7
    🐭 Mouse ► geni.us/BuY7
    💻 Monitors ► geni.us/wZFSwSK
    This video is sponsored by Brilliant.s

ความคิดเห็น • 225

  • @TheCherno
    @TheCherno  5 หลายเดือนก่อน +16

    Thanks for watching! Hope you enjoyed the video!
    Don’t forget you can try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/TheCherno. The first 200 of you will get 20% off Brilliant’s annual premium subscription!

  • @lukeburton8978
    @lukeburton8978 5 หลายเดือนก่อน +52

    This video fills a knowledge gap that I think a lot of beginner to intermediate C++ developers likely have. Thanks Yan!

  • @Mahm00dM0hanad
    @Mahm00dM0hanad 5 หลายเดือนก่อน +36

    This 2000 game engine review turns out to be supper useful, thanks a lot for both of you guys

    • @onejdc
      @onejdc 5 หลายเดือนก่อน +5

      Right? Gonna get 4,000 hours of quality YT instruction from this one guy's 2000 hours of development. Hell, we got 45 minutes from the Readme lol. Love it!

  • @GonziHere
    @GonziHere 5 หลายเดือนก่อน +7

    Easily one of your best videos to date. Thanks.

  • @amritraj3029
    @amritraj3029 5 หลายเดือนก่อน +1

    We all waiting for your video ,Love the way you teach us ❤

  • @SownJevan
    @SownJevan 5 หลายเดือนก่อน

    I was actually waiting for this for the longest time. Thanks Yan.

  • @onejdc
    @onejdc 5 หลายเดือนก่อน +42

    If you want to show us how you'd refactor his code from a maintainability standpoint into a proper setup, I think that would be extremely useful. Too often we focus on refactor for performance, but in this case, just not having to edit two files for one change is a great lesson to impart.

    • @darmath2009
      @darmath2009 5 หลายเดือนก่อน +1

      Give up with this “proper” nonsense. There’s is no proper way to do it. Gee a lot of programmers are dumb, and can’t comprehend that their way is not the “proper” way, but simply one of many.

    • @onejdc
      @onejdc 5 หลายเดือนก่อน

      Proper doesn't mean "only". There are many correct ways to do it. What's being argued for here are better ways to do things. In this case, empirically, as making a small change to a class required updating the same code in multiple files. I disagree, there are definitely proper way(S!) to do things, and ways that one should absolutely not.
      @@darmath2009

    • @RavisLifeCircle
      @RavisLifeCircle 5 หลายเดือนก่อน

      @@darmath2009 anything which saves time and redundancy is a MORE proper way.

    • @darmath2009
      @darmath2009 5 หลายเดือนก่อน

      @@RavisLifeCircle obviously English isn’t your strong point

    • @RavisLifeCircle
      @RavisLifeCircle 5 หลายเดือนก่อน +5

      @@darmath2009 cauz its not my first language not even second so cut the toxicity bruh

  • @David-oc8yt
    @David-oc8yt 5 หลายเดือนก่อน +4

    I designed something like this for my personal projects. No specific core library, but several other libraries which can be picked from and offer a little more freedom to minimize app footprints. Separating apps and libraries into corresponding subdirectories can help with organization and reusability

  • @ragnarhammarqvist3426
    @ragnarhammarqvist3426 5 หลายเดือนก่อน +38

    I would prefere "Modern CMake" over premake and have conan or vcpkg to manage dependencies.

    • @wireghost897
      @wireghost897 5 หลายเดือนก่อน

      I recently starting using Cmake with VCpkg and my God it's the best thing that happened in a while for me. It just works like magic.

    • @mariusirgens5555
      @mariusirgens5555 5 หลายเดือนก่อน +5

      Same. But its always interesting to see alternatives.

    • @malekith6522
      @malekith6522 5 หลายเดือนก่อน +1

      Same... and I usually push this combo at work.

  • @blamechickenman7434
    @blamechickenman7434 5 หลายเดือนก่อน +1

    elite video, this type of stuff is really good for beginners

  • @niteshpatel258
    @niteshpatel258 5 หลายเดือนก่อน

    Love this guy gives so much accurate details.

  • @palrevesz8629
    @palrevesz8629 5 หลายเดือนก่อน

    I love the approach; I will definitely try it out! Thank you! 👍😉

  • @P4R7Y24N7
    @P4R7Y24N7 5 หลายเดือนก่อน

    simple yet powerful, great stuff!

  • @theepicman8160
    @theepicman8160 5 หลายเดือนก่อน +21

    This might possibly be the most needed video for C++ developers.

  • @abhay29
    @abhay29 5 หลายเดือนก่อน +4

    The video we needed from ages

  • @waymanharris1284
    @waymanharris1284 4 หลายเดือนก่อน

    Thank you, I needed this!

  • @avtem
    @avtem 5 หลายเดือนก่อน

    Thank you so much for making this video!

  • @ArenGorman
    @ArenGorman 5 หลายเดือนก่อน +3

    OMG, this is something I've been looking for a long time, and no one had this as a whole guide showing best practices. Thank you so much!

  • @johnmanardiii3308
    @johnmanardiii3308 5 หลายเดือนก่อน +1

    Not sure why, but I have always had a hard time with this. Thank you!

  • @realishak
    @realishak 5 หลายเดือนก่อน

    thankssssssssss finally I waited so long for this vid!!

  • @canalbomon
    @canalbomon 5 หลายเดือนก่อน +11

    From what I understand, CMake also generates projects for Visual Studio. In this case, it's cross-platform, creating a Makefile on Unix and a Visual Studio project on Windows

    • @heavymetalmixer91
      @heavymetalmixer91 5 หลายเดือนก่อน +2

      Yeah, CMake can produce files for several IDEs/editors and cross-platform, that's why it's so popular.

    • @maxmustermann3938
      @maxmustermann3938 5 หลายเดือนก่อน +1

      More than that. Several IDEs just support CMake out of the box (i.e. they run the necessary CMake command for the given build environment internally and support the entire thing in the IDE, even helping you when you add files, no need to run any batch or shell scripts...). On top of that, you got things like vcpkg which is a package manager centered around CMake (and MSBuild) that can help you a lot.
      Got some project with a CMakeLists.txt? Just open the folder in VS Code (with proper extensions), Visual Studio, CLion, ... that's all. A bunch of years ago, we we're still using some batch script or shell script that would generate solution files or makefiles, but then support was added in Visual Studio, CLion also supported it (i think even before VS) and then VS Code came along with its platforms which can be used as an IDE supporting CMake projects on windows, linux and mac.
      Since CMake is used so widely, it's trivial to get any CMake library setup to be able to be used in your project, even if it is not contained in your package manager.

  • @qamosu
    @qamosu 5 หลายเดือนก่อน

    An awesome one! Thank you so much!

  • @buddyairguy2249
    @buddyairguy2249 18 วันที่ผ่านมา

    I am impressed at how fast you can talk and explain things. I had to slow the video down a bit to keep up :).

  • @GameDevHQ
    @GameDevHQ 4 หลายเดือนก่อน

    This is an epic starter template!

  • @oguzhanaknc2304
    @oguzhanaknc2304 5 หลายเดือนก่อน

    really valuable content THANK YOU !

  • @kuroakevizago
    @kuroakevizago 5 หลายเดือนก่อน

    At this point, I watched Cherno videos not only to learn but also as a radio, it makes me feels smarter watching your videos in the background while working XD

  • @pixeled_violence
    @pixeled_violence 5 หลายเดือนก่อน

    What an underrated channel! This guy is gold! He would deserve at least 1M sub!

  • @PauGuillamon
    @PauGuillamon 5 หลายเดือนก่อน +15

    Nice to see a video about project setup. But please people, prefer out-of-source builds! CMake supports and recommends it, I hope Premake also. While having your generated project files sitting next to your code sounds like a good idea, it will bring more problems than solutions in the future. Build into a separate folder, you can even have different folders for different build types or experiments. Deleting a single folder ensures a clean state of the project.
    in CMake:
    git clone
    cd
    mkdir build
    cd build
    cmake ..
    cmake --build .

    • @michaelterekhov1678
      @michaelterekhov1678 5 หลายเดือนก่อน +1

      Absolutely! I think that in case of crossplatform development and in case you want to make such components management the best solution is git-modules and cmake. cmake works on any platform you like, it can generate *.sln file for Windows and xcodeproject in case of MacOS. Cmake has special folders management called include(GNUInstallDirs). And it is much more pleasant then pure MAKE of unix

    • @kaoboom
      @kaoboom 5 หลายเดือนก่อน

      A quick look at the docs and you should be able to do something like this untested code:
      ```
      newoption {
      trigger = "workspacedir"
      value = "path"
      description = "Set the build directory, defaults to current directory"
      default = "."
      }
      assert(_MAIN_SCRIPT_DIR == _OPTIONS["workspacedir"], "Don't do in-source builds!")
      workspace "MyProject"
      location(_OPTIONS["workspacedir"])
      filter { "configurations:Debug" }
      targetdir(path.join(_OPTIONS["workspacedir"], "build_debug")
      filter { "configurations:Release" }
      targetdir(path.join(_OPTIONS["workspacedir"], "build")
      ```

    • @CoDEmanX47
      @CoDEmanX47 5 หลายเดือนก่อน +1

      Technically, this is not out-of-source but adjacent-to-source 😋

    • @PauGuillamon
      @PauGuillamon 5 หลายเดือนก่อน +1

      @@CoDEmanX47 I guess technically you're right 😆 but I hope it illustrates the point, you can create the folder wherever you feel like. Which is what IDEs that support CMake do many times, creating the folder somewhere else.

    • @ColinBroderickMaths
      @ColinBroderickMaths 5 หลายเดือนก่อน +1

      @@michaelterekhov1678 I agree except that git submodules are a pain in the ass unless the submodules are all completely stable. It's not something I would recommend if you're still actively working on the modules as well as the main application. You could do it as a library in a sub-folder and move it to submodule when it stabilises.

  • @d3anx
    @d3anx 5 หลายเดือนก่อน

    Awesome topics!

  • @dmytroboiko1
    @dmytroboiko1 4 หลายเดือนก่อน +2

    1. Thanks for this video. It makes a lot of sense and a good example for newbies on how to structure a C++ project properly.
    2. At this point, on Dec 31 of 2023, this is the last video in the "C++" playlist. And I watched every single video from it. Which took 23+ hours in total + half of it for writing down notes.
    THANK YOU for making this whole TH-cam-based course.
    3. Yeyyyyy!!!

  • @tri99er_
    @tri99er_ 5 หลายเดือนก่อน

    Looking forward to continuation

  • @tiennguyenthuy9958
    @tiennguyenthuy9958 หลายเดือนก่อน

    Thanks a lots from vietnam, your videos is so detail and easy to understand

  • @turbolaft
    @turbolaft 5 หลายเดือนก่อน

    🥰 Thank U for providing it not only for VS, but others, I personally adore VS code, and most of the time use it!

  • @yunuszenichowski
    @yunuszenichowski 5 หลายเดือนก่อน

    THANK YOU SO MUCH!!! you're a mind reader 👀

  • @gabigagu6599
    @gabigagu6599 5 หลายเดือนก่อน

    Could you make a video about how to design a library? or how to set up a library? BTW love your videos, keep going

  • @arjunnatarajan9406
    @arjunnatarajan9406 หลายเดือนก่อน

    You are doing a great job. I have learnt a lot from your videos. Pls make a series on CONAN package manager.

  • @malekith6522
    @malekith6522 5 หลายเดือนก่อน +2

    Great template! I still prefer my personal favorite combo: CMake with Vcpkg/Conan for handling dependencies.

    • @muratsahin1975
      @muratsahin1975 5 หลายเดือนก่อน +1

      Is not that the Industry Standart nowadays ?

    • @malekith6522
      @malekith6522 5 หลายเดือนก่อน

      No, it always depends on the team and the field you’re working in. For example, in embedded/gamedev, rarely does someone use a package manager because most of the time, you implement stuff from scratch rather than using some external library.

    • @maxmustermann3938
      @maxmustermann3938 5 หลายเดือนก่อน

      Agree. Now that vcpkg has manifests, it fixes a giant hole that previously you'd have needed conan for. I'd been using vcpkg instead of conan even before that, just preferred it, but I ran into issues where I'd check out an old repo on a new vcpkg install and the newer package versions broke it. Now you can specify dependencies and version requirements in a manifest and use it like a reasonable package manager (ofc, conan has had that long before).

  • @anwartech8193
    @anwartech8193 5 หลายเดือนก่อน

    Could you make a video on turning cmake libraries to premake and if there are some automated tools.

  • @ArgoArgus
    @ArgoArgus 5 หลายเดือนก่อน

    Hay not sure if have seen this, but have you had a look at the build chain and tooling that is coming with zig to compile/cross-compile/manage dependencies for C/C++ projects? Think it might make life easier in some way for you.

  • @ghostlucian12
    @ghostlucian12 5 หลายเดือนก่อน +1

    Before I used Autotools it was simple to use, but it was limited to Linux build systems, since I expanded my projects to windows and, I migrated the build system to CMake

  • @conflikt89
    @conflikt89 5 หลายเดือนก่อน +1

    Just a point of clarity on build systems: Both Premake and CMake are build system generators - all of the benefits that you enumerated for Premake apply to CMake as well. It would be good to see how you pull in dependencies to this template as well - do you do it manually or with a package manager?

    • @nailbomb420
      @nailbomb420 4 หลายเดือนก่อน

      The project in this video uses SFML and IMGui, and I think he added them manually.

  • @davidclark1775
    @davidclark1775 5 หลายเดือนก่อน +5

    Couple of items. Even watching here, we see repeated common blocks in your premake lua files (configurations, preprocessor defines, compiler settings, directory patterns, architectures...). I've found it very useful having a file "common.lua" and executing that using "dofile" in each premake file. Don't Repeat Yourself is a good goal. Second, is imGUI actually embedded in the source? Might be good time to discuss git submodules.

    • @mrwalter1049
      @mrwalter1049 5 หลายเดือนก่อน

      That is especially useful for things that must always be the same across those files.

  • @nolram
    @nolram 5 หลายเดือนก่อน +9

    Depending on what platforms you ship to, using Visual Studio solutions can be fine. You don‘t have to use a build system if you don‘t need it.
    Commercial games and engines have been shipped using just native IDE solutions.
    Setting up a buildsystem however is a lot more important for open source software, where you probably want to run it in as many places as possible.
    So consider if you need it, what benefits it brings, and if it‘s right for you.

  • @ahmedgasleh
    @ahmedgasleh 5 หลายเดือนก่อน +2

    This looks good. However, Can you create a template using CMake? that will be helpful too

  • @TukeTheShark
    @TukeTheShark 5 หลายเดือนก่อน

    Omfg i needed this so bad im so bad at being organized like most of us programers that would rather think than organize

  • @Code_Gains
    @Code_Gains 5 หลายเดือนก่อน

    I am taking notes.

  • @peskyjellyfish
    @peskyjellyfish 5 หลายเดือนก่อน

    Cool looking template. What do you usually use to manage dependencies? I recently started using conan for basically all C++ projects, especially when things like OpenGL, ImGUI, etc. are involved.

    • @malekith6522
      @malekith6522 5 หลายเดือนก่อน

      Vcpkg is another popular dependency management system that works with most IDEs. Also, for mostly simple stuff, git submodule is perfectly fine :)

    • @maxmustermann3938
      @maxmustermann3938 5 หลายเดือนก่อน

      I think I tried conan before, if I remember right, it has a CMake integration too. I myself use vcpkg (both with CMake, as well as in situations where I am working with visual studio solutions, since it works there too). VCPKG has all the stuff you'd need to OpenGL too, including imgui (with configurable bindings, i.e. imgui[glfw-binding,opengl3-binding] if you want opengl plus glfw setup, which is what I always use). You can also use it as a submodule if you want, since it is itself just compiled with C++, it's easy to set even that up cross-platform in your CMake script so that someone doesn't even have to manually install it.
      vcpkg also recently added manifests, which was much needed (i.e., specifying dependencies in a vcpkg.json file in your project, along with version requirements, just like conan does it)

  • @mikelong3444
    @mikelong3444 3 หลายเดือนก่อน

    This is an awsome video.

  • @dappa_chappa1307
    @dappa_chappa1307 4 หลายเดือนก่อน

    How would I add sfml to the project template? Where would I add the necessary dll, lib files ect?

  • @mobslicer1529
    @mobslicer1529 5 หลายเดือนก่อน

    another really great tool is xmake, which also uses lua but it's kind of its own build system as opposed to a metabuild system

  • @pixelsandpointers
    @pixelsandpointers 5 หลายเดือนก่อน +2

    Can you elaborate more on why premake vs CMake? I don't really get the benefit (not an ignorant question, but genuinely no idea).

    • @dmnkb
      @dmnkb 5 หลายเดือนก่อน

      Also interested

  • @ColinBroderickMaths
    @ColinBroderickMaths 5 หลายเดือนก่อน

    This one should be good. I've been waiting a long time to find out what you think is so wrong with CMake :p.

  • @magellan124
    @magellan124 5 หลายเดือนก่อน

    Can you do one on cmake too?

  • @bergerblancsuisse.
    @bergerblancsuisse. 5 หลายเดือนก่อน +1

    Thoughts on Bazel?

  • @hexcrown2416
    @hexcrown2416 19 วันที่ผ่านมา

    So i was just setting up this template to be used with glfw where i wanted to wrap glfw in the core and only expose a non glfw specific api for the app. One thing i noticed was i had to include the glfw lib as an include of app as well if i included my wrapper even know the wrapper doesn't expose any glfw specific types. Seemingly i should be able to compile glfw into my "core" lib then only include it in the app project right...? Did i set something up wrong or is this not the case?

  • @mcxMakerx
    @mcxMakerx 5 หลายเดือนก่อน

    You know the video is about to slap when the thumbnail has The Cherno with that Oppenheimer face.

  • @UnOrigionalOne
    @UnOrigionalOne หลายเดือนก่อน

    I feel like there are more build systems for C++ than there are C++ coding tutorials.

  • @LuccasSchmigel
    @LuccasSchmigel 4 หลายเดือนก่อน

    How come do you go to the end of the line and add a semicolon so fast?
    I'm looking everywhere if is there any shortcut to jump to the end of the line. People often suggest Shift+Enter, but it doesn't work.

  • @s187v
    @s187v 4 หลายเดือนก่อน

    what do you think about cmrk

  • @heavymetalmixer91
    @heavymetalmixer91 5 หลายเดือนก่อน

    Why did you choose Premake over CMake?

  • @HeavilyUngluedGuy
    @HeavilyUngluedGuy 5 หลายเดือนก่อน

    is it possible to make it work with visual studio code?

  • @anonymoussloth6687
    @anonymoussloth6687 5 หลายเดือนก่อน +2

    What's the difference between dist and release?

    • @marcasrealaccount
      @marcasrealaccount 5 หลายเดือนก่อน +3

      Dist is what most IDEs and people refer to as Release, I.e. a configuration of full optimizations and no debug information, whereas Release is a Dist build with debug information

    • @zdspider6778
      @zdspider6778 5 หลายเดือนก่อน

      @@marcasrealaccount That... doesn't make sense. "Release" should be what you actually, you know, RELEASE into the world, to the public. Adding debug information to release is like... bro, what are you even doing?

  • @sayzas9832
    @sayzas9832 5 หลายเดือนก่อน

    Finally i can get two the "actually coding" part.

  • @user-it7ps7rn7d
    @user-it7ps7rn7d 5 หลายเดือนก่อน

    Which vscode color theme been used ?

  • @sebleaf8433
    @sebleaf8433 5 หลายเดือนก่อน

    Since you like premake, have you tried xmake ? Also lua based, but superior in every way.

  • @mehadnadeem4252
    @mehadnadeem4252 5 หลายเดือนก่อน

    Say if I have a game engine that has its own renderer and physics (engine) and some other components/engines (audio, animation, etc). Are these components/engines the "Core" and then my Editor or a game can then be the "Apps" and they can include/use the core stuff? Sorry if this is hard to read and understand and my question is that does this follow Core/App architecture? and is that the genreal or recommended approach? If not please explain. Thanks

    • @y4ni608
      @y4ni608 5 หลายเดือนก่อน

      Hello, its me the creator of this engine haha. I spent the last week 60hours rewriting my whole engine into this core app strucuture, and learning cmake, and as far as i understood yes you are right, it should be implemented this way so you can #include from the static library into thr editor and game, and i LOVE it, no duped files anymore, thanks cherno lol

    • @mehadnadeem4252
      @mehadnadeem4252 5 หลายเดือนก่อน

      @@y4ni608 Ok. Thanks a lot for the reply. I’m also trying to do the same thing where I have my renderer as core and then I will try to include it wherever i need (editor, game, etc). But I’m actually just starting out. Wish me luck 😅

    • @y4ni608
      @y4ni608 5 หลายเดือนก่อน +1

      @@mehadnadeem4252 Nice, feel free to ask me if youre using CMake i could be helpful to you now haha, good luck :D

  • @HyraxGames
    @HyraxGames 5 หลายเดือนก่อน

    Aiight
    Now i am gonna write a Installer in C++ for my Game and a very complicated compression algorythm because... I like feeling like i have a popcorn brain!

  • @rankail
    @rankail 5 หลายเดือนก่อน +1

    I have a project were i need to use clion. Premake has no good support for clion. Clion does use cmake which premake can genrate but clion overrides some cmake stuff and i had to make my own version of premake-clion with some ugly hacks. No need to say i switched to cmake in the end.

  • @WeirdDuck781
    @WeirdDuck781 4 หลายเดือนก่อน

    Any integration with linux IDE/Editors? Ive been looking for an alternative to msbuild since ive migrated to linux. Been using CMake and so far it's okay

  • @Spirrwell
    @Spirrwell 5 หลายเดือนก่อน

    I used to be on the Premake train. But the integration with IDEs that CMake has just does not compare at all to what Premake offers. Premake is certainly easier for a primarily Visual Studio user for sure. But if I want to develop on Linux and not just "build" on Linux for instance, I want CMake. I'm not some die hard VIM user, I want to be able to use a graphical IDE anywhere.

  • @a_mtg
    @a_mtg 5 หลายเดือนก่อน

    Still waiting for that color theme 🙃

  • @TopConductor
    @TopConductor 4 หลายเดือนก่อน

    Can someone tell, why using premake is better than CMake?
    For me it seems like almost all libraries are using CMake nowadays.

  • @theintjengineer
    @theintjengineer 5 หลายเดือนก่อน +16

    Thanks, but CMake, C++20 Modules and vcpkg are doing their job quite well. I'll pass on this one.

  • @abcabc371
    @abcabc371 5 หลายเดือนก่อน

    Hi Cherno. Why is Project Red (Cyberpunk ) switching from the RedEngine to Unreal5 ? Why not just improve on their own engine? Isnt making games with your own engine more profitable on the long run? Is it because of some tech like Lumen and Nanite that coders at Project Red can not replicate?

    • @GameDevHQ
      @GameDevHQ 4 หลายเดือนก่อน

      The community support is invaluable. Unreal engine is light years ahead in their development. It just makes sense to use an engine that’s better.

  • @eternal6983
    @eternal6983 5 หลายเดือนก่อน +1

    What's wrong with using CMake?

    • @InZiDes
      @InZiDes 5 หลายเดือนก่อน +1

      I have the same question. Modern CMake is easy (with the correct docs) and straight forward: target_something. Precompiled headers, done. Unity builds, done. Packages, done (conan or Fetch Content). Pre or post build scripts, done.

  • @johnybaker9878
    @johnybaker9878 5 หลายเดือนก่อน +1

    7:22 fellow chatgpt user :)

  • @Stabby666
    @Stabby666 5 หลายเดือนก่อน

    I'd like to see this project fixed, ESPECIALLY the misspellings :) "darg_and_drop" and "*_initialied" etc are painful to look at!

    • @zdspider6778
      @zdspider6778 5 หลายเดือนก่อน

      initia*LIED,* yeah. 😂 No wonder it couldn't find it.
      I have a few of those in my own engine. 😳
      Would've been nice if Visual Studio was checking some basic grammar (and if you clicked on it, rememberd that you actually WANTED it misspelled). 😩

  • @slinky55710
    @slinky55710 5 หลายเดือนก่อน +1

    There is no real “one size fits all” solution for apps. Not everything needs some supporting core library and a whole build system

  • @killjaqular
    @killjaqular 5 หลายเดือนก่อน

    how do you start adding your own files?
    i right-clicked the Core project in the Solution Explorer, and i added one new file in the same directory as Core.cpp and Core.h
    its called Logger.h
    i included it in Core.cpp like so; #include
    DEVELOPING ANYWHERE ELSE this would be fine, but because Visual Studio is beyond annoying, it will not include it and is throwing errors that it cannot find a file name "Logger.h" after pressing F5
    i want to throw Visual Studio into a volcano every time i use it

    • @shawnbucholtz8082
      @shawnbucholtz8082 5 หลายเดือนก่อน

      The way I figured out:
      1. Right-click the "Core" project -> Choose "Add" -> "New Class..."
      2. Then type the name of my class "Foo" or something.
      3. Add "Source/Core" to the front of both the Foo.h and Foo.cpp file path input fields. DONT use your file browser to choose the "{Solution}/Core/Source/Core" folder. It does not work. Because... reasons? By default the files just go into the root of that solution, again because... reasons?
      4. Click "Ok".
      5. Right click "Core" solution again and click "Build".
      6. You _should_ then be able to `#include "Core/Foo.h"` in "App.cpp", build it, run it, etc.
      I dOn'T kNoW wHy YoU'rE hAvInG tRoUbLe?
      \sarcasm incase not obvious.

  • @aresaurelian
    @aresaurelian 5 หลายเดือนก่อน

    What a mess it can be if not structured properly from the beginning. This is when we would have needed a private Cherno-GPT that did what Cherno does here, and more. Well. Cherno-GPT sounds nice.

  • @ulrich-tonmoy
    @ulrich-tonmoy 5 หลายเดือนก่อน +1

    zig the new cross platform build system for c/c++

  • @jonforhan9196
    @jonforhan9196 5 หลายเดือนก่อน

    let's go

  • @h.hristov
    @h.hristov 5 หลายเดือนก่อน

    Oof. I wonder what your take on CMake would be.

  • @Entropy67
    @Entropy67 5 หลายเดือนก่อน

    That's nice, I refuse to use modern IDE's still because I'm insane, so I've only really written my own Makefiles so far. Ah the pain. I think I'm going to stop making my own Makefiles now.

  • @px2059
    @px2059 5 หลายเดือนก่อน +8

    No offense, but the guy could have used 10 hours of those 2000 hours to learn about design and save himself from all the trouble of duplicating a whole class just to add editor tools to it.

    • @Greeem
      @Greeem 5 หลายเดือนก่อน +1

      Not even just 1 class. It seems like most classes that *CAN* have editor usefulness are duplicated so they can be used without editor integration. wtf

    • @y4ni608
      @y4ni608 5 หลายเดือนก่อน

      Damn your so right, but 10h wouldnt be enough time to learn CMake or premake and actuallz apply these core-app concept. I srated this project when i was 15 and learning back then was harder compared to today using ChatGPT (its literally a cheay). I have spent the last week 60hours tlearning CMake and refactoring the whole engine into a core app structure, I LOVE. IT. im so glad i sent him mz project

  • @GameGevUA
    @GameGevUA 3 หลายเดือนก่อน

    14:59

  • @NnaemekaAmamasi
    @NnaemekaAmamasi 5 หลายเดือนก่อน

    How much dollars do I got to fork out for Premake ...??

    • @zoeherriot
      @zoeherriot 5 หลายเดือนก่อน +1

      It's free.

  • @_-Skeptic-_
    @_-Skeptic-_ 5 หลายเดือนก่อน +2

    One thing I don't understand in the new stuff, why do they use configuration files that have to be manually typed? Doing that you have to read the documentation. We are in 2023, can't they make a simple GUI to enable us to set everything and not to worry about typing something wrong? (not only premake, even in vscode, many extensions do that)

    • @thepaulcraft957
      @thepaulcraft957 5 หลายเดือนก่อน +4

      More stuff to maintain. Text files are just plain text. Everybody can edit it. You can always open and read it

    • @giovannisolimeno5040
      @giovannisolimeno5040 5 หลายเดือนก่อน +6

      You would still need to read the tool's configuration, also the written config files are easily diffable and manageable through a vcs

  • @manuelgonzales6483
    @manuelgonzales6483 5 หลายเดือนก่อน

    🎉❤😊

  • @rayrayray
    @rayrayray 5 หลายเดือนก่อน +1

    Premade is a huge mistake. Why would should newb this?

  • @JustPlainRob
    @JustPlainRob 5 หลายเดือนก่อน

    Better Title: "Dr Makefile; How I Learned to Stop Microsofting and Love Build Systems"

  • @majormalfunction0071
    @majormalfunction0071 5 หลายเดือนก่อน

    As a game dev on Linux, GNU Make kinda sucks at the language level. The guts are good, and I can make it work, but it's not ideal.
    I'm supporting Linux and Windows and bidirectional cross-compilation (build Win64 on Linux, test via WINE; build Linux on Windows, test via WSL).
    It's a mess, as you might expect.

    • @v01d_r34l1ty
      @v01d_r34l1ty 5 หลายเดือนก่อน

      I do hobby projects in C/C++ and even CMake sucks (although it is the best option). Half the time you can't do what you want to do, and dealing with PMs like vcpkg and conan are a huge PITA.

  • @Marlon-ld2jx
    @Marlon-ld2jx 5 หลายเดือนก่อน

    The best way to setup C++ projects is: Use Rust

  • @alvincheng809
    @alvincheng809 5 หลายเดือนก่อน +1

    Honestly, I just dump all of the code on the root directory and slap on a readme file 😅

  • @areunderscore
    @areunderscore 5 หลายเดือนก่อน

    Sure it's not, but this project looks completely like a troll project to drive ppl trying to contribute crazy. Madness.

  • @h7qvi
    @h7qvi 5 หลายเดือนก่อน

    I just use Autoconf/automake and m4 😅

  • @bloodredtape
    @bloodredtape 5 หลายเดือนก่อน +3

    Looks like cherno is a seller now, not an educator.
    Let me explain. I am a big fan of Yan and his content. I've been following him for almost 5 years and noticed something. It's not a problem of this particular video, more like a trend for the last year.
    Yan is trying to sell his products now, not to teach something. Obviously this video is for c++ newbies, because for experienced dev there is no problem to google build
    system's spec and setup project structure himself. Also there is no problem to create such a template for personal use if required. Therefore this template is mean for newbies.
    But what would a c++ newcomer gain from such a template? Will he learn how build systems work? Maybe understand why Yan made decisions he made? Anything else? You see the trend here. It would be much more helpful to make a video or a series on premake itself. Show how to build different types of projects, subprojects, static/dybamic libraries. Add compile definitions, flags, etc. But unfortunately all people get is the ability to tweak your template. That's such a weak knowledge. No doubts this template is convenient and useful, but if Yan wants to teach people build systems and project structure you shouldn't sell people your template. You should focus on giving people all the knowledge required to build their own!
    Same with headless video series, same with walnut, they are great tools, but....
    However you have great fresh material like ray tracing series or game engine series. They give knowledge, not a product! I'd rather watch a single rtx episode once a month instead of 4 new-template-linrary-use-not-care stuff.

  • @KyleGarzon-gx3hd
    @KyleGarzon-gx3hd 3 หลายเดือนก่อน

    Hehe, basic Cmake knowlege (google) and a bash script go crazy

  • @rickr530
    @rickr530 5 หลายเดือนก่อน

    I think premake is a toy and CMake is the tool that adults in industry use.

  • @billynugget7102
    @billynugget7102 5 หลายเดือนก่อน +181

    Generally a bad idea to teach premake where 90% of all projects are cmake based in the c++ world and the rest are either make or .bat/.sh scripts. I have never seen any major library be built with premake so i would highly recommend investing your time into learning cmake over premake as it really is the industry standard besides its pain points that the cherno has. Bad take honestly on this one

    • @nolram
      @nolram 5 หลายเดือนก่อน +36

      Highly disagree. Cmake is an ancient relic that should be deprecated in any sensible codebase. It‘s not backward compatible, causes many points of breakage, is slow, has terrible documentation and generally causes more issues than it solves.

    • @zweitekonto9654
      @zweitekonto9654 5 หลายเดือนก่อน +22

      marry cmake for the shows, have an affair with premake. That what I would like to do.

    • @sids911
      @sids911 5 หลายเดือนก่อน +11

      I do agree with it although premake is lot easier than Cmake in my opinion, also for gamedev it's pretty easy to setup. I just spent 3 days to fully setup a pretty complex HPC based library for my next project in Cmake so I am pretty damn salty because of all the different compilers I have to run and flags I support.

    • @Drischdaan
      @Drischdaan 5 หลายเดือนก่อน +21

      CMake is literally trash. I started with using CMake and it's so confusing, has bad or non existing learning resources and is so complex without any reason. Premake is very beginner friendly and is highly configurable at the same time

    • @albertgarcia3048
      @albertgarcia3048 5 หลายเดือนก่อน +9

      I totally agree. If you lack knowledge of any preprocessor or project configuration tool, you are NEVER going to create a complex enough project to need the "simplicity" of Premake over the much faster CMake.
      CMake is much more difficult to configure? True, but only for large code projects. For simple or even medium size projects, CMake is the way to go, and one of the key points is that is the industry standard.
      DO NOT start with Premake for a simple project, you will spend more time setting all the files and configurations than just running cmake .. && make