#trying to install <cpr> library but i cant seem to fix the issue

213 messages · Page 1 of 1 (latest)

tacit viper
#

Im trying to learn libraries in c++ so i could send http request but installing <cpr> is a pain in the ass

dull sand
#

How did you try to install it?

tacit viper
#

i use vcpkg

#

and build cmake in my file

#

idk everything seems confusing to me

#

i followed the instructions from here

dull sand
#

I don't want to watch the video honestly

tacit viper
#

ill explain in thoroughly

dull sand
#

Look at the instructions of the library

tacit viper
#

where could i find that?

dull sand
#

You don't need to run git clone https://github.com/Microsoft/vcpkg.git again if you already have vcpkg

tacit viper
#

okay wait a min ill try from that guide

haughty muskBOT
#

@tacit viper has reached level 1. GG!

tacit viper
#

whats a git commit?

#

is this the right ay to set it up?

#

@dull sand

dull sand
#

Yea you can use cmake instead of vcpkg

tacit viper
#

mm it still displays error squiggles after i add it what did i do wrong

dull sand
# tacit viper whats a git commit?

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

dull sand
#

da40186618909b1a7363d4e4495aa899c6e0eb is 4 days old so you can stick with that

tacit viper
#

basically i still cant use <cpr>

dull sand
#

Try to use a more new cmake version

#

FetchContent was added in 3.11

tacit viper
#

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?

dull sand
#

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

tacit viper
#

4.0.3

haughty muskBOT
#

@tacit viper has reached level 2. GG!

dull sand
#

great

#

then set cmake_minimum_required to 4.0.3 too

tacit viper
#

i did it

#

what else should i do?

dull sand
#

Build again and show your outputlog if it's not working

tacit viper
#

Cmake: Build?

dull sand
#

yes

tacit viper
#

so everytime i change my cmakelists.txt i need to rebuild?

dull sand
#

yes, within some environments that's done automatically in the background though

tacit viper
#

i cant do >cmake: build why is that

#

and when i try doing >Cmake: delete cache and reconfigure it errors

dull sand
tacit viper
#

u said i should build again

dull sand
#

Yep

tacit viper
#

when i try to do >cmake: build it is not in the list

dull sand
#

Well, I don't know what is in your list

#

You can share a screenshot if you want

tacit viper
dull sand
#

What error do you get when you select delete cache and reconfigure?

tacit viper
#

this shows up when i debug

dull sand
#

maybe try to remove the 5.12.0, idk why that is there

tacit viper
#

can u show me which one is the 5.12.0?

dull sand
#

wait

dull sand
#

looks like you removed the 7

#

try to copy it again 🙂

tacit viper
#

da40186618909b1a7363d4e4495aa899c6e0eb5.12.0 this is what i should copy?

#

the second one?

dull sand
#

where do you have that from? the github repo says da40186618909b1a7363d4e4495aa899c6e0eb75.12.0

tacit viper
#

umm idk tbh

#

wait

dull sand
#

FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git GIT_TAG da40186618909b1a7363d4e4495aa899c6e0eb75.12.0) just use this

tacit viper
#

copied from here

dull sand
#

can you share your cmakelists.txt again just for me to verify?

haughty muskBOT
#

@tacit viper has reached level 3. GG!

dull sand
#

ah perfect

dull sand
#

CMake: Delete Cache and Reconfigure

tacit viper
#

okay

#

still error idk why

#

wait ill ss

dull sand
#

sure

#

that's how it goes, fix one error, then the next

tacit viper
dull sand
#

Then try it with FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git GIT_TAG da40186618909b1a7363d4e4495aa899c6e0eb)

tacit viper
#

gotchu

dull sand
#

hmmm

#

working=?

tacit viper
#

its taking a long time

#

i screenshoted the bottom part only should i ss it all?

dull sand
#

You can copy it to pastebin

tacit viper
#

oh

#

how do i send it to u

#

thats the debug one

#

ill just fix it tmr morning im tired 💔

dull sand
#

try to install meson

#

maybe something that FetchContent requires? idk

tacit viper
#

what is meson?

dull sand
#

A build system

#

Means it's cpr specific

tacit viper
tacit viper
dull sand
#

wait is it tomorrow morning for you already?

tacit viper
#

yeah

dull sand
#

damn im still awake

tacit viper
#

last chat was at 10pm

dull sand
#

its almost 4am here

tacit viper
#

lmao damn

#

ill install mason

tacit viper
#

haha

dull sand
#

Should be pretty similar

dull sand
tacit viper
#

do i need to uninstall cmake?

dull sand
#

your still using cmake

tacit viper
#

oh okay

dull sand
#

it probably just needs mason for a external lib that is using mason instead of cmake

tacit viper
#

i see

haughty muskBOT
#

@tacit viper has reached level 4. GG!

tacit viper
#

how could i install mason from github?

#

using vcpkg?

dull sand
#

no

#

wasn't there a link?

#

in the error you got

tacit viper
#

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?

dull sand
tacit viper
#

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?

dull sand
#

no you only install it and still build with cmkae

#

cmake*

#

make sure that its in PATH

#

then rebuild cmake

tacit viper
#

so now i try to rebuild?

tacit viper
dull sand
#

try to run meson --version

#

if that worked hten rebuild cmake

tacit viper
dull sand
#

great

#

i'll get some sleep now

#

the birds are already telling me to wake up lmao

tacit viper
tacit viper
#

ill just get someone else to help

#

thank u bro

tacit viper
#

<@&1246441066878599291> <@&1130473404345110621> anyone could help me?

solemn magnet
tacit viper
#

oh sorry

solemn magnet
#

Are you using meson or cmake?

tacit viper
#

im using both

tacit viper
#

should i try to rebuild all of this from scratch?

#

start all over again

solemn magnet
tacit viper
tacit viper
solemn magnet
#

It would make more sense to stick to a single build system

#

AndIi suggest you pick cmake

tacit viper
#

hmm

#

ill try to restart the process from scratch

#

okay i started out with a fresh file

#

what should i do first?

dull sand
tacit viper
#

to install cpr

dull sand
#

but you are using cmake fetch_content?

tacit viper
#

idk about that i just did what the youtube told me to do

dull sand
#

shouldn't have listened to youtube

tacit viper
#

i see

haughty muskBOT
#

@tacit viper has reached level 5. GG!

tacit viper
#

but where do i learn these stuff if i dont follow yt?

dull sand
#

you can use vcpkg but then you don't use cmake fetch_content

dull sand
#

it suggests multiple ways

#

you either use vcpkg or you use something else like cmake fetch_content

tacit viper
#

so vcpkg and cmake fetch_content should be used seperately?

dull sand
#

those are two independent things

tacit viper
#

wow damn

#

yeah the yt title is misleading

#

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?

dull sand
#

you have to decide which one you want to use

dull sand
tacit viper
#

hmm

#

im just a beginner soo i just follow anything tbh

#

idk if it was wrong

dull sand