error: unknown type name 'CURL'

error: unknown type name 'CURL'

我编写了一个 C 库,它利用 libcurl 库与 REST API 进行交互。我是在基于 debian 的系统上写的,但现在正试图在 Arduino 上使用它,运行 是一个 OpenWRT 发行版。在尝试使用它时,我注意到当编译器尝试使用 libcurl 库时出现问题,所以我写了一个超级简单的程序来测试它。

#include <curl/curl.h>

void main() {
    CURL *curl;
}

然后我就这样编译了...

gcc -lcurl test.c -o test

并得到以下内容。

test.c: In function 'main':
test.c:4:2: error: unknown type name 'CURL'

libcurl 已安装在设备上。

Package libcurl (7.29.0-1) installed in root is up to date.

这是我 运行 opkg 文件 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

最难找出问题所在。 link 是我发现的唯一与我的问题非常相似的问题,但解决方案对我不起作用。有人有什么建议吗?

谢谢。

编辑: 所以我想我找到了有关该问题的更多信息。我想我也遗漏了很多 libcurl 开发包,因为我查看了 opkg.conf 文件并看到唯一的包列表如下。

http://downloads.arduino.cc/openwrtyun/1/packages

也许我需要找到一个包含我需要的额外 libcurl 包的 OpenWRT 包列表?不过我好像找不到。

所以我能够解决我的问题,但我想不是 "properly"。

显然,我 运行 的 OpenWRT 发行版使用了完全不同的 libcurl 库,当我尝试卸载它时, opkg 包管理器警告我,因为它也使用了当前安装的 libcurl 库,如果我删除它可能会损坏。

因此,我从 Github 手动安装了我需要的 libcurl 版本,然后在我的代码中进行了适当的引用以改用其他版本。

感谢大家帮助我找到正确的方向。