未找到 lib 卷曲符号

发布于 2024-09-25 14:10:39 字数 976 浏览 4 评论 0原文

真是愚蠢的C题。

我正在尝试在这里构建源代码,以便我可以开始为自己修改它

http: //curl.haxx.se/libcurl/c/ftpget.html

我下载该文件,然后运行

gcc -o test ftpget.c

并获取,

Undefined symbols:
  "_curl_global_init", referenced from:
      _main in ccFchguB.o
  "_curl_easy_perform", referenced from:
      _main in ccFchguB.o
  "_curl_easy_setopt", referenced from:
      _main in ccFchguB.o
      _main in ccFchguB.o
      _main in ccFchguB.o
      _main in ccFchguB.o
  "_curl_easy_cleanup", referenced from:
      _main in ccFchguB.o
  "_curl_easy_init", referenced from:
      _main in ccFchguB.o
  "_curl_global_cleanup", referenced from:
      _main in ccFchguB.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

这对我来说没有意义,因为

/usr/local/include/curl/curl.h

存在并具有这些功能。我确信这是我所缺少的一些基本的 c 编译的东西。

非常感谢您的指点。

Really stupid C question.

I'm trying to build the source code here so I can start on modifying it for myself

http://curl.haxx.se/libcurl/c/ftpget.html

I download the file, then run

gcc -o test ftpget.c

and get

Undefined symbols:
  "_curl_global_init", referenced from:
      _main in ccFchguB.o
  "_curl_easy_perform", referenced from:
      _main in ccFchguB.o
  "_curl_easy_setopt", referenced from:
      _main in ccFchguB.o
      _main in ccFchguB.o
      _main in ccFchguB.o
      _main in ccFchguB.o
  "_curl_easy_cleanup", referenced from:
      _main in ccFchguB.o
  "_curl_easy_init", referenced from:
      _main in ccFchguB.o
  "_curl_global_cleanup", referenced from:
      _main in ccFchguB.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

which makes no sense to me, because

/usr/local/include/curl/curl.h

exists and has these functions. I'm sure this is some basic c compilation thing I'm missing.

Many thanks for any pointers.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若有似无的小暗淡 2024-10-02 14:10:39

您需要链接到curl库:

gcc -o test ftpget.c -lcurl

You need to link with the curl library:

gcc -o test ftpget.c -lcurl
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文