How-To Use C++ Libraries (without relying on a package manager)

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 มิ.ย. 2024
  • In this video, we talk about C++ Libraries and how to generally use them with your project. Examples are given with Visual Studio Community Edition and GLFW3. Some basic knowledge of programming is assumed.
    -- Chapters --
    0:00 intro
    0:51 finding available C++ libs
    1:48 static vs dynamic libs
    3:19 C++ package manager options
    5:53 starting sample visual studio proj
    7:25 x86 unable to start workaround
    8:16 cloning + building open source libs
    17:46 including the built library
    27:04 closed source libs (binary only)
    27:30 going forward options
    28:30 outro
    -- CTT Links --
    ▶ / codetechtuts
    ▶ / discord
    ▶ github.com/codetechtuts
    ▶ codetechtuts@gmail.com [Business]
    -- Other CTT Playlists You Might Like --
    ▶ CMake: • CMake Tutorial EP 1 | ...
    ▶ Beginner Cpp: • Beginner C++ Episode 0...
    ▶ Blender Video Editing: • How To Edit Video with...
    ▶ Matrix Math: • Matrix Math - Basic Co...
    ▶ OpenAL: • OPENAL TUTORIAL
    ▶ OpenGL: • OpenGL Part 1 - NEW PR...
    Thanks for coming to the channel to check out a video on Code, Tech, and Tutorials.
  • บันเทิง

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

  • @collapsingspace
    @collapsingspace 2 ปีที่แล้ว +38

    Lmao i have never seen any youtuber getting stuck in the middle of the video with an error he has no idea about, then he goes into solving it for a minute eventually gives up and moves ahead with the video and keeps all this in the final edit of the video 🤣🤣🤣🔥🔥🔥🔥👏👏

  • @_Mojius_
    @_Mojius_ 3 ปีที่แล้ว +15

    Do a part 2 gosh darn it!!! I wanna watch it

  • @Junjokar
    @Junjokar 2 ปีที่แล้ว +7

    I'm getting into C++ for the first since college and this definitely helped, thanks for the content!

  • @sedelonx5138
    @sedelonx5138 ปีที่แล้ว +1

    You have no idea how much I struggled to find an explanation of this. LIFE SAVER

  • @tljstewart
    @tljstewart 3 ปีที่แล้ว +3

    This is gold man, please do a part 2!

  • @tuanazzam6320
    @tuanazzam6320 3 ปีที่แล้ว +3

    Hey, I have to say just one thing, you are awsome man. I just went through your tutorial set about cmake.. And it is clear as it should be....... Keep up the good work. Peace!!!

  • @asd99579
    @asd99579 3 ปีที่แล้ว +1

    Never have been so pleased with music outro.

  • @alexmattyou
    @alexmattyou 13 วันที่ผ่านมา

    Wow, I can understand the power of Github. I never know this before. I usually download the source and built it. Great tutorial thanks.

  • @DevLearn-lv7nr
    @DevLearn-lv7nr 11 หลายเดือนก่อน

    perfectly paced guide - thanks

  • @marcoorca6208
    @marcoorca6208 2 ปีที่แล้ว +1

    Thanks, now I understand it a bit better now!

  • @kb-wu7ws
    @kb-wu7ws 3 ปีที่แล้ว +19

    So damn confused. Feels pretty hopless trying to learn this shit on my own

    • @cesarcalderon2499
      @cesarcalderon2499 2 ปีที่แล้ว +3

      Dude its hard. Is not easy you wont learn in 1 year or day. I been studying cpp for 2 years the basic making simple shitty projects. Then after im done i have to pick a library to start on and learn it. You wont learn cpp in a year. Do 1 hour a day. Is how i do it. First years is hard while you learning the basics. Once you know what you know the rules of cpp then you move to make big projects. Keep pushing. I been for 2 and i havent done anything excited yet im almost done with the basics. Memory allocation is the hardest part so far. Just keep pushing... dont forget to live life.. 1 hour a day will do. Put a timer with 60min count down and work. Force your brain to learn it by writting code in a paper..using ide all the time is bad

    • @cesarcalderon2499
      @cesarcalderon2499 2 ปีที่แล้ว +1

      1 hour a day and live life it will change your attitudes and way of thinking

    • @Gogglesofkrome
      @Gogglesofkrome ปีที่แล้ว +1

      An hour a day is ok, but 365 hours a year is too slow unless you're already weighed down with other responsibilities. Learning something new and valuable requires for you to make the time for it, otherwise you'll have years pass

  • @finalename7464
    @finalename7464 3 ปีที่แล้ว +21

    That was a relatively simple example. What about something more complicated? Building the Qt library or building a cross compiler toolchain. What about many additional dependencies that you may need only for building libraries and not using them? Also what about different kinds of build systems used by all those libraries and their dependencies? That's why there are people who prefer the conan or vcpkg. Package managers save time, nerves and mental energy. Do you prefer building your own LFS or using some more practical prebuilt Linux distro?

  • @KamalSelvamBow
    @KamalSelvamBow 3 ปีที่แล้ว +12

    Hi, could you do a tutorial on adding an already existing library like (OpenCV) into your own CMakeLists. So that when you build, CMake automatically downloads the opencv from resources repository, builds it and links it with your project.

  • @jcfausto
    @jcfausto ปีที่แล้ว

    Well explained! Thanks 👍

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

    Amazing video, you make it sound easy lol. But you helped me with a problem here, thanks :)

  • @adrianom9537
    @adrianom9537 ปีที่แล้ว

    Hello, trying to set up xerces lib but i get stuck at the testing part, i'm on windows, do we have to set up system path to some directory to make it run on VS ?
    Anyway thanks for your amazing videos, it really helps understand the complexity of C++

  • @thierrybeaulieu4403
    @thierrybeaulieu4403 2 ปีที่แล้ว

    Amazing!

  • @dobcs3236
    @dobcs3236 ปีที่แล้ว

    Thank you very much ❣️

  • @DevLearn-lv7nr
    @DevLearn-lv7nr 6 หลายเดือนก่อน

    hi - the libraries you were trying to find during the video - were they pre compiled library objects or just source code libraries (that need to be compiled) ?

  • @Feglawy
    @Feglawy ปีที่แล้ว

    Thanks a lot ❤

  • @xuxusito
    @xuxusito 3 ปีที่แล้ว +1

    Thanks for this video! I really would like to see how to do this on linux with cmake.

  • @bara7979
    @bara7979 ปีที่แล้ว

    Thank you

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

    I'm familiar with how to add header and library directories in Visual Studio, but I have been learning how to use VS Code. Does VS Code have a similar place to enter header/library directories like Visual Studio?

  • @martinimrich2453
    @martinimrich2453 4 หลายเดือนก่อน +1

    Ďakujeme.

  • @mohammadkarami8984
    @mohammadkarami8984 3 ปีที่แล้ว

    thanks a lot

  • @ajayjadhav900
    @ajayjadhav900 2 ปีที่แล้ว

    How to include sub-directories in Visual Studio?
    I have to include many header files, which are in different sub-directories. Is there a way in Visual Studio (I am using 2013 edition) to set one include path that Visual Studio will search also the sub-directories for header files?
    My Project is in C/C++.
    Add the "base folder" to the project (project properties -> Configuration Properties -> C/C++ -> Additional Include Directories, "additional include directories")
    I have tried the above option but it is not possible for me to add each and every directory followed by a semicolon.
    I have total 60 + different C C++ sub-directories

  • @likwidmocean
    @likwidmocean 4 ปีที่แล้ว +2

    I'm prepping for an interview with aws for alexa embedded functionality built in c++. Most my experience is in c#, any architecture advice? Odd gotchas, stuff like that?

    • @rosshoyt2030
      @rosshoyt2030 4 ปีที่แล้ว +2

      Just took a course on software architectures. if that's the topic you mean, then you need to think more generally and not only about a specific language implementation. Architectures are usually developed using 4+1 view diagrams, quality attribute requirements, use cases, and more.

    • @rosshoyt2030
      @rosshoyt2030 4 ปีที่แล้ว +2

      Did a quick Google search and this paper might be relevant ( or just Google "embedded system software architecture" and select 3rd link). It discussed how to develop an embedded system architecture, so it isn't an 'example' architecture, but might shed some light on the topic. Might be useful! www.google.com/url?sa=t&source=web&rct=j&url=acs.pub.ro/~cpop/SMP/Embedded%2520book/Pages%2520from%2520Embedded%2520Systems%2520Architecture%2520-%2520A%2520Comprehensive%2520Guide%2520for%2520Engineers%2520and%2520Programmers.pdf&ved=2ahUKEwiB3I6RwPrpAhWToFsKHamHDGIQFjAMegQIAhAB&usg=AOvVaw3Q0C0WUDD1-ejqa4yxDACf

    • @CodeTechandTutorials
      @CodeTechandTutorials  4 ปีที่แล้ว +3

      It is difficult to pinpoint a single thing. C++ is notorious for having many deep, dark, rarely explored bits of (sometimes odd) functionality, so it does take a good amount of experience. My advice would be to code some projects in C++ and research anything and everything that comes up that you're not sure about. It certainly took me a while to get to were I am, and I'm still learning new stuff almost every time I code. Best of luck in the interview!

    • @CodeTechandTutorials
      @CodeTechandTutorials  4 ปีที่แล้ว +1

      Awesome to see some community action! Thanks for the link.

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

    One question, I've seen some people put the library path in "Additional library directories" under linker options, instead of putting them in the "Library directory" of the VC++ Directories. What difference does that make? Are they just two options for the same thing? When I try it, both methods work, but I dont know what is going on when i do that.

  • @zeuglcockatrice4633
    @zeuglcockatrice4633 ปีที่แล้ว

    great video but what is that wallpaper? It's amazing and I need it

  • @User_00128
    @User_00128 ปีที่แล้ว

    Watching on a phone is really hard pls keep this in mind other than that thanks for the great content

  • @c3cris2
    @c3cris2 ปีที่แล้ว +1

    Question: I come from python/php background, what if you don’t build the library, you just include all it’s source ? Is that possible? Why must you build the lib if you can just include all it’s source code?
    Sorry that’s how python/php works, and it’s confusing me.
    Thank you

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

      One reason I can think of is you don't want to share the source code of third party libraries in your project, for exemple: your project is open-source but the third party libraries you're using are not.

  • @salimp2009
    @salimp2009 3 ปีที่แล้ว +1

    can you make a video on how to install conan on Windows..i spent an hour but nothng on their web site worked for me; i have Python, pip and VS Studio installed and using it regularly but Somehow conan is tricky to install. for me ...it will be great if some directs like a step step by video or anythng that works for dummies :) will be great..just trying to learn. i have using learning premake and want to learn conan and cmake as well

  • @schmidtpeter5276
    @schmidtpeter5276 4 ปีที่แล้ว +1

    I used to code in C++ but I switched to python (i was young, don't judge me lol) and now I'm going back to C++. Any advice or learning strategy for the second time? I feel like a totally forgot a lot of things and it's a bit confusing.

    • @CodeTechandTutorials
      @CodeTechandTutorials  4 ปีที่แล้ว +1

      Starting fresh projects always helped me. If it all goes wrong scrap it and start again. That way you get it ingrained in your mind how to the build systems work. Best of luck.

    • @schmidtpeter5276
      @schmidtpeter5276 4 ปีที่แล้ว +2

      @@CodeTechandTutorials Thanks! Btw great videos! (Gilfoyle whould be proud of you xd)

    • @verdrehteseele8525
      @verdrehteseele8525 2 ปีที่แล้ว

      what's wrong to code in a particular language? python in this case?

  • @micahwright7760
    @micahwright7760 24 วันที่ผ่านมา

    I tried using this method for curl but it didn't work. Could you make a video tutorial for this specific case?

  • @kqvanity
    @kqvanity ปีที่แล้ว

    0:35
    It's actually npm, but close enough!

  • @autodev3682
    @autodev3682 ปีที่แล้ว +1

    I don't think anybody really knows C++, Maybe Mr. Stroustrup knows some of it but at one point the language took its own course and now people are just struggling in including files and libraries to the point where you need to read two or three books and watch hours of tutorials.

  • @vishnuvardhanreddy220
    @vishnuvardhanreddy220 3 ปีที่แล้ว +1

    17:46 : how to include library

  • @yamin2000
    @yamin2000 2 ปีที่แล้ว

    10,000 views
    it was me

  • @tielessin
    @tielessin ปีที่แล้ว +2

    This guy is soo guy, he just accidentally wrote the code for a virus in under a minute. In just 6 lines of code he put fear into the bones of one of the biggest tech companies in the world [7:20]

  • @laxmanadhikari3989
    @laxmanadhikari3989 2 ปีที่แล้ว

    How can i do it on linux 😓

  • @MFRSIAM
    @MFRSIAM 2 ปีที่แล้ว

    Please make a video on conan

  • @huyvole9724
    @huyvole9724 2 ปีที่แล้ว

    What is he doing? Can anyone explain?

  • @davidhall7275
    @davidhall7275 3 ปีที่แล้ว +2

    while watching this I am waiting to learn how to use C++ libraries. Speaking of Conan and numerous other products does not show me how to use libraries. References to all these extraneous matters is a grind. You mention the difference between static and dynamic libraries as an aside--information I am seeking--and then go on to google matters which simply waste my time. Can you understand how I feel?

  • @pleinclosens8304
    @pleinclosens8304 2 ปีที่แล้ว +1

    I remember this guy as "Our Lord , Saviour" from his CMake tutorial. Now he looks like Jesus Christ everytime I see him.

  • @officialp283
    @officialp283 ปีที่แล้ว +1

    Thjis is hell.

  • @sanjacobs6261
    @sanjacobs6261 2 ปีที่แล้ว

    *without relying on a package manager, but still being completely reliant on Visual Studio

    • @CodeTechandTutorials
      @CodeTechandTutorials  2 ปีที่แล้ว +1

      Visual Studio doesn't do much to help really. It's either that or make files or cmake or premake or just save your build commands in a script. There are just so many options for project files. None of them in particular help with the library side including visual studio unless, you use the package manager nuget or vcpkg. In reality probably should use some kind of package manager because managing libraries becomes kind of a pain after a while but it's nice to do a few manually to get an understanding of how they work. Cheers

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

    *laughs in Linux* most libs are in distro repos, glm, boost ...