libcpr / cpr

C++ Requests: Curl for People, a spiritual port of Python Requests.
https://docs.libcpr.org/
Other
6.29k stars 903 forks source link

unable to compile anything after installing cpr library #980

Closed Conansmith100 closed 7 months ago

Conansmith100 commented 7 months ago

Description

sudo g++ -o /usr/local/bin/t1 '/home/ubuntu/Desktop/test1.cpp' I am encountering an error while attempting to compile any cpp file, regardless of which one it is. The error message reads: "as: error while loading shared libraries: libcpr.so.1: cannot open shared object file: No such file or directory."

Example/How to Reproduce

  1. Create a cpr::Session
  2. Set option ...
  3. Perform the request
  4. See error

Possible Fix

Initially, I attempted to export the library's location to the environment variable by using the following command: "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/". Although this approach seemed effective at first, it ultimately proved to be unsuccessful.

Where did you get it from?

GitHub (branch e.g. master)

Additional Context/Your Environment

COM8 commented 7 months ago

By default cpr is build as a shared library. Therefore you either have to compile statically (cmake .. -DBUILD_SHARED_LIBS=OFF && cmake --build . --parallel), or install also libcpr.so.1 into for example /usr/lib64.