人们到处都说你必须安装 libcurl。但我在 manjaro 上并且安装了curl,仓库中没有libcurl。
不知道现在该怎么办。
In file included from ../main/main.c:1:
../main/main.cpp:2:10: fatal error: curl/curl.h: No such file or directory
#include <curl/curl.h>
^~~~~~~~~~~~~
➜ lib sudo find /var/lib -name "curl.h"
/var/lib/flatpak/runtime/org.gnome.Sdk/x86_64/3.38/5f699dd2ab3afb8c078649a1b0ef0624b54550037663570564826afd9fc5df42/files/include/curl/curl.h
/var/lib/docker/overlay2/14ac69baa1d75f37492f33a3996b04e0dd4764c19554f1a68450cf1b59e42947/diff/usr/include/x86_64-linux-gnu/curl/curl.h
/var/lib/docker/overlay2/8e36839fbd749a189f85c2474af52036e879e54580c91c000564c6e0925bfd95/diff/usr/include/x86_64-linux-gnu/curl/curl.h
答案1
您可以找出哪个包包含文件curl/curl.h
:
$ # update search cache first
$ pacman -Fy
$ # now look for packages containing a file that matches curl/curl.h
$ pacman -Fx /curl/curl.h
usr/include/curl/curl.h is owned by core/curl 7.82.0-1
usr/lib/pacman/include/curl/curl.h is owned by core/pacman-static 6.0.1-2
usr/include/obs/util/curl/curl-helper.h is owned by community/obs-studio 27.2.1-1
usr/include/tarantool/curl/curl.h is owned by community/tarantool 2.9.0-3
因此,curl
您收到的小瓶包装中pacman -S curl
就含有该物质。如果您的构建没有找到该文件,则意味着由于某种原因,默认包含路径 /usr/include 不是编译器查找标头的位置。您的构建设置有些奇怪!但这不是 manjaro 的错;某些东西必须明确告诉你的 C 工具链不是查看 manjaro 安装标头的默认位置。