CMake Tutorial EP 11 | VSCODE | VCPKG Libraries | Project Setup Basics

Поделиться
HTML-код
  • Опубликовано: 24 сен 2024
  • I've heard the question from several different people and even on the GitHub issues: how do you set up a C++ project and libraries in vscode? This should answer that question for the msbuild and vcpkg versions, but can be adapted as necessary if you are using a different compiler or OS.
    -- References --
    ▶ github.com/cod...
    ▶ github.com/mic...
    -- Artists --
    ▶ end background: wallhaven.cc/w...
    ▶ song1: Smooth and Cool - Nico Staf
    ▶ song2: Finding Synergy - Jeremy Korpas
    ▶ song3: Landing - Godmode
    ▶ song4: To Pass Time - Godmode
    -- The Full CMake Playlist --
    ▶ CMake: • CMake Tutorial EP 1 | ...
    -- CTT Links --
    ▶ Join the Coder's Discord: / discord
    ▶ See the Channel Repos: github.com/cod...
    ▶ Contact (Business only): codetechtuts@gmail.com
    ▶ Amazon Affiliates Link: amzn.to/3bVQ9X0
    ▶ Become A Patron: / codetechtuts
    -- Other CTT Playlists You Might Like --
    ▶ 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. Hopefully you found something useful or interesting. Feel free to leave a comment down below. I will respond to as many as I can.
    Other ways to support me, Matt, the creator and maintainer of this channel:
    ▶ Follow/Sub to my Twitch Stream: / overridetheprogram
    One Time Donation Options:
    ▶ PayPal: paypal.me/matt...
    ▶ Bitcoin: 1BWSeM3YtxJPKLJyz1q24xf6XgPDdGwaJe
    ▶ Ethereum: 0xcf73ab2e4c2fa7d78d59b586066f91619eb650f0 _support:
    ☕ www.patreon.co...
    Patrons help this channel go round and keep creating. If you don't like patreon but still would like to support regularly, you can do a similar subscription via the RUclips Join, or through Github's sponsor button.
    🕮github.com/cod...
    This is were I most the majority of the code seen on the channel.
    ✍ / discord
    We have a Discord! We welcome all various code and tech chatter.
    ☯ / bytepro17124
    I stream code and/or gaming every Thursday! I also randomly stream a time or two throughout most weeks. _support:
    ☕ www.patreon.co...
    Patrons help this channel go round and keep creating. If you don't like patreon but still would like to support regularly, you can do a similar subscription via the RUclips Join, or through Github's sponsor button.
    🕮github.com/cod...
    This is were I most the majority of the code seen on the channel.
    ✍ / discord
    We have a Discord! We welcome all various code and tech chatter.
    ☯ / bytepro17124
    I stream code and/or gaming every Thursday! I also randomly stream a time or two throughout most weeks.

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

  • @singha360
    @singha360 3 года назад +6

    I personally prefer clangd for my intellisense for C and C++ over the official Microsoft.
    Great vid btw!

  • @Ashish_singh_dev
    @Ashish_singh_dev 10 месяцев назад +1

    // for those who are not getting packages
    //make vcpkg.json at the root of your project with below content
    {
    "name": "main",
    "version": "0.1.0",
    "dependencies": [
    "fmt",
    "jsoncpp"
    ]
    }
    // add path of vcpkg in environment variable if not added
    run "vcpkg install" where vcpkg.json is present
    now run "cmake -S path-of-source-code -B path-of-build-folder"

  • @Geospatial_Guru
    @Geospatial_Guru Месяц назад

    Appreciate your efforts, Can you please do an example actual complicated project , like for example I have been struggling to build GDAL from source.🙏

  • @castanhojfc
    @castanhojfc 2 года назад +1

    Hey I was only able to use "CMAKE_TOOLCHAIN_FILE" if I installed the library with "vcpkg install fmt --triplet x64-windows". Maybe that explains the issue.

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

    I can't include any library using this cmake thing. I tried using the toolchaine same thing. I tried using the prefix path same thing. I tried the Integrate install same thing. The funny thing is the compiler finds the packages and the library but when i try to include the header file in the .c file it throws an error : no such file or directory !

  • @calinradu9673
    @calinradu9673 3 года назад +2

    I would like to see a video about C and C++ books, which you have read and you liked.

    • @CodeTechandTutorials
      @CodeTechandTutorials  3 года назад +5

      I could probably do that at some point, all the things I went through to get to where I am now as a programmer video.

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

      @@CodeTechandTutorials That will be great!!

  • @calinradu9673
    @calinradu9673 3 года назад +2

    UUUUUU, cool animation :D

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

    Is that possible to install a specific version of a lib, i want to use an older version of proj:x64-windows in order to have proj_api.h?

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

    Is it possible to install a package with vcpkg with one of its dependency libraries from my local machine instead vcpkg downloading and installing?

  • @christopherprobst-ranly6284
    @christopherprobst-ranly6284 2 года назад +1

    I also tried the toolchain thing many times, no success. Just retried it after watching this video, now success!

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

    Why there isn't a `target_include_directories` and `target_link_directories`?

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

    Hello! At was trying at first with mingw, and I ran into a problem when compiling, at the linking state, was showing something like "undefined reference to '__imp__ (...) basic_string_view (...) ". I tried a few different things, like using the CMAKE_PREFIX_PATH for "/vcpkh/vcpkg/installed/x86-windows/share" (and/or x64-windows), and I played with the cmake generator "MinGW Makefiles". I eventually got it working using the set(CMAKE_TOOLCHAIN_FILE "path-to-vcpkg.cmake") variable, no cmake_prefix_path, and generator "Visual Studio 16 2019" and building with MSBuild.exe "demo.sln", as you used on your project.
    Thank you for your videos! I've learned a lot throughout them, trying different things and learning how to troubleshoot problems.

    • @adamhendry945
      @adamhendry945 2 года назад +1

      Undefined reference to '_imp_' is usually a linker error: you may not have added the 'target_link_libraries' or 'target_link_directories' that you need.

  • @AHermas
    @AHermas 2 года назад +1

    2:00 why you playing horror music in the background I'm scared AF watching this tutorial

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

    i also found way to link libraries in vscode using MSYS2 for mingw and vcpkg -MSVC
    I found on my own all this things by understanding vcpkg working in visual studio

  • @Ash-fo4qs
    @Ash-fo4qs Год назад

    how to install IO2D ??

  • @DorotheaAbdul-x8p
    @DorotheaAbdul-x8p 9 дней назад

    Rodriguez Mount

  • @TrumanHamiltion
    @TrumanHamiltion 15 дней назад

    557 Renner Street

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

    Sorry, the explanation is unclear and assumes a lot of prior knowledge. Where do I start?

  • @jacobg6178
    @jacobg6178 Месяц назад

    +REP

  • @BrunoDempsey-s4r
    @BrunoDempsey-s4r 15 дней назад

    Elyse Cape

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

    Your explanation is unfortunately very confusing (a lot of 'but' and 'so' etc)!