#trying to install <cpr> library but i cant seem to fix the issue
213 messages · Page 1 of 1 (latest)
How did you try to install it?
i use vcpkg
and build cmake in my file
idk everything seems confusing to me
i followed the instructions from here
UPDATED BLOG POST: https://blog.elijahlopez.ca/posts/vcpkg-cmake-tutorial/
GITHUB REPO: https://github.com/elibroftw/cpp-vcpkg-cmake-example
This video helps clear up issues with using 3rd party libraries in C++ in a cross platform and reusable way.
00:00 Compiler and IDE
00:45 CMake 3.22+
01:04 Installing Vcpkg
03:47 Installing a library
04:1...
I don't want to watch the video honestly
ill explain in thoroughly
Look at the instructions of the library
where could i find that?
You don't need to run git clone https://github.com/Microsoft/vcpkg.git again if you already have vcpkg
okay wait a min ill try from that guide
@tacit viper has reached level 1. GG!
include(FetchContent)
FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git
GIT_TAG da40186618909b1a7363d4e4495aa899c6e0eb75.12.0) # Replace with your desired git commit from: https://github.com/libcpr/cpr/releases
FetchContent_MakeAvailable(cpr)
whats a git commit?
is this the right ay to set it up?
@dull sand
Yea you can use cmake instead of vcpkg
mm it still displays error squiggles after i add it what did i do wrong
Developers of the library do commits to the project and you can select what version of the library you want to use by replacing the git tag
oh i see
da40186618909b1a7363d4e4495aa899c6e0eb is 4 days old so you can stick with that
What errors?
so i delete the cmake version now?
and reinstall it?
https://cmake.org/download/
i downloaded from this recently so it should be the latest one no?
You can either download binaries or source code archives for the latest stable or previous release or access the current development (aka nightly) distribution through Git. This software may not be exported in violation of any U.S. export laws or regulations. For more information regarding Export Control matters please go to https://www.kitware...
what cmake version do you have currently installed?
cmake --version
you have to change the version you set in cmake_minimum_required in your cmakelists.txt
4.0.3
@tacit viper has reached level 2. GG!
Build again and show your outputlog if it's not working
Cmake: Build?
yes
so everytime i change my cmakelists.txt i need to rebuild?
yes, within some environments that's done automatically in the background though
i cant do >cmake: build why is that
and when i try doing >Cmake: delete cache and reconfigure it errors
What do you mean by that?
u said i should build again
Yep
when i try to do >cmake: build it is not in the list
What error do you get when you select delete cache and reconfigure?
maybe try to remove the 5.12.0, idk why that is there
can u show me which one is the 5.12.0?
wait
this screenshot shows the GIT_TAG da40186618909b1a7363d4e4495aa899c6e0eb75.12.0 but the error shows that it tried to checkout tag da40186618909b1a7363d4e4495aa899c6e0eb5.12.0
looks like you removed the 7
try to copy it again 🙂
da40186618909b1a7363d4e4495aa899c6e0eb5.12.0 this is what i should copy?
the second one?
where do you have that from? the github repo says da40186618909b1a7363d4e4495aa899c6e0eb75.12.0
FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git GIT_TAG da40186618909b1a7363d4e4495aa899c6e0eb75.12.0) just use this
copied from here
can you share your cmakelists.txt again just for me to verify?
kay got it
@tacit viper has reached level 3. GG!
ah perfect
CMake: Delete Cache and Reconfigure
lmao
Then try it with FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git GIT_TAG da40186618909b1a7363d4e4495aa899c6e0eb)
gotchu
You can copy it to pastebin
oh
<script src="https://pastebin.com/embed_js/Nak7piBM"></script>
how do i send it to u
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
thats the debug one
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
ill just fix it tmr morning im tired 💔
what is meson?
A build system
The error comes from here btw: https://github.com/libcpr/cpr/blob/02f0ebf94d48f6944b340c630af78cd8fff6cc74/cmake/libpsl.cmake#L7
Means it's cpr specific
is it like cmake?
ohh
wait is it tomorrow morning for you already?
yeah
damn im still awake
last chat was at 10pm
its almost 4am here
damn
do i need to uninstall cmake?
https://github.com/mapbox/mason is thisthe right one?
oh okay
it probably just needs mason for a external lib that is using mason instead of cmake
i see
@tacit viper has reached level 4. GG!
ah i didnt see it
nvm it as meson instead of mason
should be this one right?
Meson is implemented in Python 3, and requires 3.7 or newer. If your operating system provides a package manager, you should install it with that. For platforms that don't have a package manager, you need to download it from Python's home page. See below for platform-specific Python3 quirks
why does it say python
ill just install it first
do i need to add meson to path like cmake?
oops meant meson
yep
C:\Program Files\Meson
is it this one?
with the meson.exe inside it?
ok i linked it
so this is how i build it?
no you only install it and still build with cmkae
cmake*
make sure that its in PATH
then rebuild cmake
oh okay
so now i try to rebuild?
i alr linked meson to path
it orks
it still errors lmao but its okay if u want to sleep
ill just get someone else to help
thank u bro
<@&1246441066878599291> <@&1130473404345110621> anyone could help me?
Don't ping for help
oh sorry
Are you using meson or cmake?
im using both
bcs of this error
should i try to rebuild all of this from scratch?
start all over again
Why?
there was an error
this
It would make more sense to stick to a single build system
AndIi suggest you pick cmake
hmm
ill try to restart the process from scratch
okay i started out with a fresh file
what should i do first?
what are you using vcpkg for?
to install cpr
but you are using cmake fetch_content?
idk about that i just did what the youtube told me to do
shouldn't have listened to youtube
i see
@tacit viper has reached level 5. GG!
but where do i learn these stuff if i dont follow yt?
you can use vcpkg but then you don't use cmake fetch_content
the library has it's own documentation on how to use it
it suggests multiple ways
you either use vcpkg or you use something else like cmake fetch_content
so vcpkg and cmake fetch_content should be used seperately?
those are two independent things
wow damn
yeah the yt title is misleading
UPDATED BLOG POST: https://blog.elijahlopez.ca/posts/vcpkg-cmake-tutorial/
GITHUB REPO: https://github.com/elibroftw/cpp-vcpkg-cmake-example
This video helps clear up issues with using 3rd party libraries in C++ in a cross platform and reusable way.
00:00 Compiler and IDE
00:45 CMake 3.22+
01:04 Installing Vcpkg
03:47 Installing a library
04:1...
it says like this
i thought it should be used together
ill try to install it from scratch
can u walk me trough the steps on how u would install one?
and should i delete cpr from vcpkg?
you have to decide which one you want to use
not really actually
i recommend you to create a new cmake project in visual studio and use cmake fetch_content OR vcpkg