gpt4 book ai didi

c++ - Curlpp 的问题

转载 作者:行者123 更新时间:2023-11-30 03:47:02 27 4
gpt4 key购买 nike

当我编译这段代码时:

#include <iostream>
#include <curlpp/cURLpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>

int main() {
cURLpp :: Cleanup cleanup;
std :: cout << "Hello world" << std :: endl;

return 0;
}

通过控制台:

g++ main.cpp -lcurlpp

有很多错误,例如:

/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libcurlpp.so: undefined reference to `curl_getenv@CURL_OPENSSL_3'

仅与 CURL_OPENSSL_3 连接

我该如何解决?谢谢

Ubuntu 15.04,curl 版本 - 7.38.00,curlpp - 安装 sudo apt-get install libcurlpp-dev

最佳答案

在 Mint 17 上,我能够使用以下命令编译和运行您的程序

g++ main.cpp -lcurl -lcurlpp

查看程序的库转储,您可能缺少以下可以使用 apt-get 安装的库:

libssl-1.0.0
libcurl4-openssl-dev

LD 转储

$ ldd a.out 
linux-vdso.so.1 => (0x00007fff701fe000)
libcurlpp.so.0 => /usr/lib/x86_64-linux-gnu/libcurlpp.so.0 (0x00007f896cd05000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f896c9f7000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f896c7df000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f896c41a000)
libcurl.so.4 => /usr/lib/x86_64-linux-gnu/libcurl.so.4 (0x00007f896c1b3000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f896beac000)
/lib64/ld-linux-x86-64.so.2 (0x00007f896cf68000)
libidn.so.11 => /usr/lib/x86_64-linux-gnu/libidn.so.11 (0x00007f896bc79000)
librtmp.so.0 => /usr/lib/x86_64-linux-gnu/librtmp.so.0 (0x00007f896ba5f000)
libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f896b7ff000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f896b424000)
libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f896b1dd000)
liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007f896afcd000)
libldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007f896ad7c000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f896ab63000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f896a944000)
libgnutls.so.26 => /usr/lib/x86_64-linux-gnu/libgnutls.so.26 (0x00007f896a686000)
libgcrypt.so.11 => /lib/x86_64-linux-gnu/libgcrypt.so.11 (0x00007f896a406000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f896a201000)
libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f8969f36000)
libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f8969d07000)
libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f8969b02000)
libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f89698f7000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f89696dc000)
libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007f89694c0000)
libgssapi.so.3 => /usr/lib/x86_64-linux-gnu/libgssapi.so.3 (0x00007f8969282000)
libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f896906e000)
libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f8968e2b000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f8968c26000)
libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f8968a22000)
libheimntlm.so.0 => /usr/lib/x86_64-linux-gnu/libheimntlm.so.0 (0x00007f8968818000)
libkrb5.so.26 => /usr/lib/x86_64-linux-gnu/libkrb5.so.26 (0x00007f8968590000)
libasn1.so.8 => /usr/lib/x86_64-linux-gnu/libasn1.so.8 (0x00007f89682ee000)
libhcrypto.so.4 => /usr/lib/x86_64-linux-gnu/libhcrypto.so.4 (0x00007f89680bb000)
libroken.so.18 => /usr/lib/x86_64-linux-gnu/libroken.so.18 (0x00007f8967ea6000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f8967c9d000)
libwind.so.0 => /usr/lib/x86_64-linux-gnu/libwind.so.0 (0x00007f8967a74000)
libheimbase.so.1 => /usr/lib/x86_64-linux-gnu/libheimbase.so.1 (0x00007f8967866000)
libhx509.so.5 => /usr/lib/x86_64-linux-gnu/libhx509.so.5 (0x00007f896761c000)
libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007f8967363000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f896712a000)

关于c++ - Curlpp 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33858186/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com