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.
I personally prefer clangd for my intellisense for C and C++ over the official Microsoft.
Great vid btw!
Good choice!
// 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"
Appreciate your efforts, Can you please do an example actual complicated project , like for example I have been struggling to build GDAL from source.🙏
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.
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 !
I would like to see a video about C and C++ books, which you have read and you liked.
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.
@@CodeTechandTutorials That will be great!!
UUUUUU, cool animation :D
Btw, thanks. Really helpful videos!
Thanks!
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?
Is it possible to install a package with vcpkg with one of its dependency libraries from my local machine instead vcpkg downloading and installing?
I also tried the toolchain thing many times, no success. Just retried it after watching this video, now success!
Why there isn't a `target_include_directories` and `target_link_directories`?
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.
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.
2:00 why you playing horror music in the background I'm scared AF watching this tutorial
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
how to install IO2D ??
Rodriguez Mount
557 Renner Street
Sorry, the explanation is unclear and assumes a lot of prior knowledge. Where do I start?
+REP
Elyse Cape
Your explanation is unfortunately very confusing (a lot of 'but' and 'so' etc)!