GCC 找不到 curl 库 [英] GCC can't find curl library
问题描述
我有一个 Dragino Yun Shield(它基本上是一个 Arduino Yun,运行 OpenWRt Linino)并且我已经按照此处的说明在其上安装了 GCC:
I have a Dragino Yun Shield (it's an Arduino Yun basically, running OpenWRt Linino) and I have installed GCC on it as explained here:
http://www.sniff.org.uk/2014/05/building-gcc-for-yun-in-12-not-easy.html
编译器似乎可以很好地满足我的需要(一些浮点警告除外),但我遇到了问题.我的 C 程序需要 curl 库,但链接器找不到它:
The compiler seems to work fine for my needs (except for some floating point warnings) but I run into a problem. My C program requires the curl library and it can't be found by the linker:
gcc -shared -fPIC kii_cloud.c kii_custom.c kii_prv_utils.c -L jansson -I curl -I jansson -l jansson -l curl -o libkii.so
/mnt/sda1/gcc/bin/ld: cannot find -lcurl
collect2: ld returned 1 exit status
make: *** [build] Error 1
但是安装了 libcurl 包:
but the package libcurl is installed:
> opkg files libcurl
Package libcurl (7.29.0-1) is installed on root and has the following files:
/usr/lib/libcurl.so.4
/usr/lib/libcurl.so.4.3.0
似乎没有可用的 libcurlX-dev 包(就像在大型 Linux 发行版中一样).
It seems there's no libcurlX-dev package available (as in big Linux distros).
有什么办法可以解决这个问题吗?/usr/lib/libcurl.so 是链接器想要的吗?
Is there any way to fix this? Is /usr/lib/libcurl.so what the linker wants?
最好的问候和感谢.
推荐答案
我通过创建一个符号链接来解决它,如下所示:
I solved it by creating a symbolic link as follows:
cd /usr/lib
ln -s libcurl.so.4.3.0 libcurl.so
最好的问候
这篇关于GCC 找不到 curl 库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!