C++ Easy Mode -- Getting Started with C++ (Using VCPKG)

Поделиться
HTML-код
  • Опубликовано: 13 сен 2024

Комментарии • 111

  • @gamefromscratch
    @gamefromscratch  4 года назад +6

    Step by Step Tutorial Link:
    gamefromscratch.com/vcpkg-cpp-easy-mode-step-by-step-tutorial/
    Timeline:
    0:01 Introduction and overview
    1:07 Getting your compiler and other pieces installed
    4:30 Installing VCPKG
    8:08 Searching for and installing packages
    11:44 Using a VCPKG in Visual Studio
    15:18 Installing and configuring Visual Studio Code
    18:57 Creating your Visual Studio Code based CMake project
    20:30 Configuring Code to work with VCPKG
    23:46 Creating your Run configuration
    24:41 Compiling a Raylib project
    25:50 A few more CMakeFiles.txt tweaks

  • @lucasrasera1320
    @lucasrasera1320 4 года назад +23

    Oww, i spend 3 hours yesterday trying to make raylib work in VSCode, and didnt made it. Thank you!

  • @monolofiminimal
    @monolofiminimal 4 года назад +8

    I thoroughly enjoy seeing your recents on C:\temp

  • @jadrianmc3420
    @jadrianmc3420 4 года назад +25

    Lol what a coincidence for me, I was just starting to learn C++

    • @BosakMaw
      @BosakMaw 4 года назад

      same

    • @felixinfinita3777
      @felixinfinita3777 4 года назад +11

      The last thing you want to do when you start learning C++ is messing with libs

    • @franciscogerardohernandezr4788
      @franciscogerardohernandezr4788 3 года назад

      @@felixinfinita3777 it is the pain of C++, specially when learning to use Visual Studio options.

  • @notgate2624
    @notgate2624 4 года назад +16

    Heads up: Putting a project on GitHub with a CMake that references your own locally installed deps is not good.

  • @silveresperanza5957
    @silveresperanza5957 8 месяцев назад

    I'm still quite new with C++ and have noticed that it is a boring and arduous process to manually setup libraries which made me find out about VCPKG. I've looked through numerous videos to be left confused with a lot of question and little clarification. But your video has clarified my confusion and has gotten everything to work for me. Thanks a ton!

  • @harshrathod50
    @harshrathod50 4 года назад +2

    The Visual Studio Code part is really really very helpful.

  • @boredkarma708
    @boredkarma708 Год назад

    Even tho I know most of c++ I have never been able to install libraries since I didn't get how, you are a lifesaver sir thank you so much.

  • @Hoowwwww
    @Hoowwwww 4 года назад +41

    git clone --depth=1 to avoid downloading the entire git repository

  • @kenmaready54
    @kenmaready54 2 года назад

    I've been trying to figure this out for days. This video is a lifesaver. Thank you.

  • @SamirPatnaik
    @SamirPatnaik 4 года назад +1

    This is an absolute lifesaver kind sir. I tried to get it running an year ago but failed, miserably. I'm 100% sure I couldn't have figured it out with your video. Appreciation and gratitude from the bottom of my heart.

  • @ernestomilan3628
    @ernestomilan3628 3 года назад

    Thanks, great tutorial. I spent about 3 days trying to do all this, and nothing. With your video I did it in 30 min

  • @Ryan-bn6kq
    @Ryan-bn6kq 4 года назад +1

    Omfg, thank you so much. I was trying to figure this out for hours...

  • @harveybates1386
    @harveybates1386 4 года назад +1

    amazing, I love c++ but the library management has always been a real problem for me. Thank you so much :)

  • @ahrenmorris6053
    @ahrenmorris6053 4 года назад +2

    Bahahah
    Love the "Recent" list at 18:04. I'm guessing there was a few cracks at this before the video got made?

    • @gamefromscratch
      @gamefromscratch  4 года назад

      My build system didn’t appreciate me uninstalling and reinstalling to make the video, that actually happens quite a lot, I get something figured out, uninstall to start from scratch for the video and some leftovers mess it up. In this case it was cmake caching

  • @SixteenVoice
    @SixteenVoice 4 года назад +1

    Wow. Very powerful. Thank you Sir.

  • @brodriguez11000
    @brodriguez11000 4 года назад +4

    Does this come with an "Easy" button? :-)

  • @CaiLewendon
    @CaiLewendon Год назад

    your a saviour

  • @joshbishop
    @joshbishop 4 года назад +1

    Two words: HELL. YES

  • @hammer86_
    @hammer86_ 4 года назад +1

    We definitely could use a package manager for C++. Conan looks like another good one. I use MSYS2, which uses the pacman package manager. It has over 1800 packages but sadly no raylib.

  • @mnajim7538
    @mnajim7538 4 года назад

    Holy Shit!, just to say hello world in c++, 15min tutorial is needed. DAMN!

  • @openroomxyz
    @openroomxyz 2 года назад

    That was super cool!

  • @benoitrousseau4137
    @benoitrousseau4137 4 года назад

    Vcpkg is pretty good, just be aware that although it builds every library locally, it does not work very well for non-usual platforms. I tried to compile a simple C++ game on a Raspberry Pi for my children to play and experiment with, but I never got vcpkg to work and I ended up using the apt-get version of the bigger libs and directly including the code of the smaller libraries directly in the project. It's not a big deal and I really can't fault Microsoft for not putting engineer time on exotic platforms, but it's something to be aware of if you're going to depend on vcpkg to manage your project's libraries.

    • @BrainSlugs83
      @BrainSlugs83 4 года назад

      Yeah, if you're using Linux, there are more established (non-cross platform) options. This is more to fill the gap for Windows users I think.

  • @nintandrew13
    @nintandrew13 3 года назад +1

    For visual studio, I tried installing a package (gtkmm) which depends on other packages. Vcpkg installed all of them, but when I go to compile in visual studio, it cannot locate the other package headers.
    Having to individually include each package seems insane (there are several dozen of them). Is there something else that needs to be done for packages that are more than a single header?

  • @user-lz2oh9zz4y
    @user-lz2oh9zz4y 4 года назад +2

    Now I can debug my Raylib code

  • @xshawn287
    @xshawn287 4 года назад

    very nice tutorial!

  • @edinetgrunhed6000
    @edinetgrunhed6000 Год назад

    finally i found what i want

  • @remigoldbach9608
    @remigoldbach9608 4 года назад +3

    Do you prefer VS Code or VS ? Btw nice video

    • @_tsu_
      @_tsu_ 4 года назад +2

      know you didn't ask but from my experience
      For c++ on windows, VScode is unusable so full VS it is. But VScode is decent on Linux and Mac. But there are better IDEs on those platforms.
      For JS/Python, VScode is arguably the best IDE for those languages.

    • @gamefromscratch
      @gamefromscratch  4 года назад +5

      For C++, Visual Studio, Visual Studio Code features just aren't quite there yet. For an editor or small projects, Visual Studio Code 100%

    • @SixteenVoice
      @SixteenVoice 4 года назад +1

      VSCode is great for training when students are using their own machines which can be Win/Linux/Mac. It is similar to Eclipse which runs a virtual environment that looks the same on all OSs. Other than that, no real need to use it that I've seen.

    • @jadrianmc3420
      @jadrianmc3420 4 года назад +2

      I used VS Code for Unity which is a very good substitute for Unity Monodevelop after it got taken down. It may not have too many features but there are alot plugins and stuffs for any scripting also its storage allocation is light, very light. It's designed for access efficiency and lightweight. VS Code = Good for scripting and editing, VS = Best for programming.

    • @2012knp
      @2012knp 4 года назад +2

      Real programmers use Vim

  • @mainframeboi3338
    @mainframeboi3338 3 года назад

    Thanks guy

  • @TheSpacecraftX
    @TheSpacecraftX 4 года назад

    Does vcpkg have similar functionality as CMAKE where you can keep all your project files and build stuff separate from your source for clean source control with visual studio? So you don't need to include libraries. Or do you have to use VS Code the way you did here to make that so easy? And can you use the step-through debugger seeing as it's the Release mode compiler that VS Code seems to autodetect?

  • @ozu7779
    @ozu7779 14 дней назад

    omg i wish i know this 3 years before ;(

  • @creativity5155
    @creativity5155 4 года назад

    Looks handy !

  • @hacker2075
    @hacker2075 6 месяцев назад

    Seems it wont work with static libraries.

  • @ChonkyWantsACat
    @ChonkyWantsACat 4 года назад +4

    18:10 your frustrations are visible :p

    • @xinaesthetic
      @xinaesthetic 4 года назад

      Darshan Phaldesai I don’t think so, he’s just stressing that that’s a useful feature you’re going to want to get used to using if you work with VSCode.

    • @ChonkyWantsACat
      @ChonkyWantsACat 4 года назад +1

      @@xinaesthetic No no, you did not see his recent projects lol

    • @xinaesthetic
      @xinaesthetic 4 года назад

      @@ChonkyWantsACat I stand corrected. 😄

  • @akshayazariah
    @akshayazariah 4 года назад +6

    Heh, could've used one of these a few years ago...

  • @soumyadrip
    @soumyadrip 3 года назад

    I followed the tutorial step by step from vs code editor, but I am having this error "LINK : fatal error LNK1104: cannot open file 'boost.lib' [C:\Users\USER\Desktop\cpp1\build\cpp1.vcxproj]", Dont understand why this thing is happening, Tried many stackoverflow threads but most of them are explaining for Visual studio IDE. Please NEED HELP.

  • @yaroslavpanych2067
    @yaroslavpanych2067 3 года назад

    Did he ever fix that typo with scripts/buildsystems/vcpkg.cmake ? it has cmake extension for me, and it was so for years, and he used .make . Is that cause why all that wizardry with variables is required?

  • @zahrarizkiannisa724
    @zahrarizkiannisa724 3 года назад

    How to fix "No suitable Visual Studio instances were found" when downloading nuget??
    This problem occur when running command : .\vcpkg.exe install raylib:x64-windows

  • @mbilimbimbovu2970
    @mbilimbimbovu2970 3 года назад

    Hey sorry..how can i create a makefile that includes the library that i have downloaded from vcpkg? Please help :)

  • @Xeab
    @Xeab 4 года назад +3

    I'm actually really surprised at the amount of effort needed on windows compared to Linux

    • @hipihypnoctice
      @hipihypnoctice 4 года назад +1

      It's terrible. After switching to Linux life was great

    • @omarabdulla9628
      @omarabdulla9628 4 года назад

      Is it easier to work with C++ dependencies on Linux? I’m considering switching to MacOS because of the UNIX core, would that also help with C++ development?

    • @Xeab
      @Xeab 4 года назад +2

      Omar Abdulla, not exactly dependencies, but almost everything will be easier, for instance you don’t need to install a huge beast like visual studio just to compile c++, you just install gcc or clang, although most development on macOS requires Xcode, which is hardly any better than visual studio, on linux nothing is required, you just find the tool(s) you like with the features you want, get to making things, nothing getting in your way

    • @skaruts
      @skaruts 4 года назад

      Can you compile for windows from linux?

    • @Xeab
      @Xeab 4 года назад +1

      skaruts, Yes! You can use a set of tools called MinGW - Minimalist GNU for Windows, the same GNU as in gnu/linux, allowing you to use gcc to compile windows binaries from linux or windows. Its my preferred toolchain for windows since its free and open source.

  • @aminaqadeer7570
    @aminaqadeer7570 2 года назад

    what to do incase of Visio code?

  • @broganking9830
    @broganking9830 4 года назад

    18:20 recent projects make it seem like you were having a bad time :D

  • @123goforme8
    @123goforme8 4 года назад +1

    9:43 lol, well at least it's there 😅

  • @charanpreetsinghbhatia7184
    @charanpreetsinghbhatia7184 3 года назад

    .\bootstrap-vcpkg.bat is not creating an exe file, how can it be countered ?

  • @us07251
    @us07251 3 года назад

    OMG!! I miss pip install :(

  • @FurtoMega
    @FurtoMega 3 года назад

    fucking amazing. Thank you

  • @gower1973
    @gower1973 4 года назад +1

    I dont see what the problem is about adding a few headers and linking libraries, its pretty much a prerequisite for beginners to do this to learn the language and how things work, I do see the benefit for experienced users to streamline their workflow, but it seems like a fair bit of hassle to setup.

  • @omarabdulla9628
    @omarabdulla9628 4 года назад +1

    I’m giving this a try soon when I get some free time, I hope it works and maybe then I can finally build something with C++. The dependency stuff has always driven me away from C++. Looking at Pip, npm, and nuget, the package and dependency management in C++ just seems like a complete joke.

  • @therealgunny
    @therealgunny 4 года назад +4

    composer came out in 2012 for php,
    they should have done this a long time ago for c++ xd

  • @matanmigdal7108
    @matanmigdal7108 4 года назад

    this support any git hub repository ?

  • @SoicBR
    @SoicBR 3 года назад

    I love you

  • @theman3282
    @theman3282 4 года назад

    From the caption i was thinking c++ without all those pointer error... lol...

  • @RichardRoquemore-o9o
    @RichardRoquemore-o9o 2 дня назад

    Perez Maria Martinez William Garcia Daniel

  • @jameshill936
    @jameshill936 4 года назад

    I'm glad to see the frustrated naming scheme of fuck2 and fuckthisshit when he opened VSCode

  • @nonetrix3066
    @nonetrix3066 3 года назад

    This is awesome but I am worried about people having to install vcpkg just to compile my code

  • @BrainSlugs83
    @BrainSlugs83 4 года назад

    Like for the like god. Comment for the comment throne.

  • @Liam-pf7ih
    @Liam-pf7ih 4 года назад +2

    After watching the video I wrote how I setup c builds on windows here gist.github.com/LiamSwarbrick/96bb3236f85a81761b0b9695107f295b I find using just a batch file that calls the compiler once to be very simple. and makes adding libs like raylib easy (even though its c it shouldn't be much different to c++, change gcc to g++ etc..)

  • @vasiapatov4544
    @vasiapatov4544 3 года назад

    17:58
    sickofthis
    fuck2
    fuckthisshit
    He's one of us

  • @Mautar55
    @Mautar55 4 года назад +2

    You know... This is a good reason to replace cpp

    • @2012knp
      @2012knp 4 года назад

      YEEEEEAAAAAAAAAS, the time for Ada to shine has COME!

    • @BrainSlugs83
      @BrainSlugs83 4 года назад

      @@MiiDev69 a number of Languages claim to be direct successors, including D, and C#.
      IMHO, C# is almost always a better choice (especially for large projects, or where SDLC is a consideration). But I understand it's not always an option.

    • @perregrinne2500
      @perregrinne2500 4 года назад +1

      @@BrainSlugs83 I figured that C# might end up being my application building go-to language till I picked up Rust. Performance is much more on par with C/C++, automatic memory deallocation without any hindrance of a garbage collector, all the modern memory protections, data race prevention, the list goes on... I don't even miss C#, to be honest.

    • @omarabdulla9628
      @omarabdulla9628 4 года назад +1

      Michael Jensen I love C#, it’s honestly an amazing language and I’ve been using it for the last couple of months on a project I was working on, but you also have to remember that it’s a higher level language that isn’t suitable to replace a lower level language like C++. In the project I was working on we relied heavily on struct bitfields when it came to storing data and reading data. There was no native support for bitfields in C# in any capacity, and we had to do a lot of Boolean arithmetic to simulate bitfields which I’ll admit made things a little slower.

    • @skaruts
      @skaruts 4 года назад

      @Codely That's never been true except for AAA studios. And it's starting to change.

  • @panvrek8952
    @panvrek8952 4 года назад +1

    I miss the DJGPP days.... so much easier

  • @starxhilmie
    @starxhilmie 4 года назад

    It's says "easy" but i highly doubt it

  • @FleshToDust
    @FleshToDust 4 года назад

    This looks much more complicated than just booting up an engine and start coding.

    • @nextlifeonearth
      @nextlifeonearth 4 года назад +1

      Nobody ever said it wasn't. You do get much more control tho.

  • @MikeNugget
    @MikeNugget 4 года назад

    In my opinion this tutorial is not for beginners. Also the amount of excess words destroys structure of the lesson.
    Despite all, nice try.

  • @erenjeagerot
    @erenjeagerot 2 года назад

    I am getting the following error while running the this command: .\vcpkg.exe integrate install
    .\vcpkg.exe : The term '.\vcpkg' is not recognized as the name of a cmdlet, function, script file, or operable program. Che
    ck 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
    + .\vcpkg integrate install
    + ~~~~~~~
    + CategoryInfo : ObjectNotFound: (.\vcpkg.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException