GCC 未定义的符号

发布于 2024-08-20 07:16:38 字数 763 浏览 7 评论 0原文

我最近放弃了 MacPorts,转而使用 Homebrew,因此我现在遇到了 make 的一些问题。即这个错误:

/Developer/usr/bin/llvm-gcc   -rdynamic -o zsh main.o  `cat stamp-modobjs`   -liconv -ldl -ltermcap -lm  -lc
Undefined symbols:
  "_libiconv_open", referenced from:
      llvm bitcode in utils.o
  "_libiconv_close", referenced from:
      llvm bitcode in utils.o
  "_libiconv", referenced from:
      llvm bitcode in utils.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [zsh] Error 1
make: *** [install.bin] Error 2

似乎这三个库没有链接或其他什么。老实说,我是一名 Ruby 开发人员,从来不需要编译任何东西,所以我真的不知道去哪里解决这个问题。当我从源代码编译任何东西时就会发生这种情况。

在上面的示例中,这是安装 zsh 时运行 make 时的输出

I recently ditched MacPorts for Homebrew, as a result im now experiencing some issues with make. Namely this error:

/Developer/usr/bin/llvm-gcc   -rdynamic -o zsh main.o  `cat stamp-modobjs`   -liconv -ldl -ltermcap -lm  -lc
Undefined symbols:
  "_libiconv_open", referenced from:
      llvm bitcode in utils.o
  "_libiconv_close", referenced from:
      llvm bitcode in utils.o
  "_libiconv", referenced from:
      llvm bitcode in utils.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [zsh] Error 1
make: *** [install.bin] Error 2

It seems those three libraries aren't linked or something. To be honest I'm a Ruby Developer and never have to compile anything so don't really know where to go to fix this. It happens when I compile anything from source.

In the example above that is the output when running make when installing zsh

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

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

发布评论

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

评论(2

只等公子 2024-08-27 07:16:38

似乎 libiconv 未链接,您确实向命令行提供了 -liconv,因此似乎该库未安装或至少无法供标准位置中的链接器使用。你安装了libiconv吗?

It seems libiconv is not linked in, you do supply -liconv to the command line, so it seems that the library is not installed or at least not available to the linker in the standard locations. Do you have libiconv installed?

断爱 2024-08-27 07:16:38

你为什么使用 llvm-gcc ?为了获得最大的兼容性,您最好使用 gcc-4.0 或 gcc-4.2,它们都作为 OS X 10.6 中开发人员工具的一部分安装。

Why are you using llvm-gcc ? For maximum compatibility you'd be better of with gcc-4.0 or gcc-4.2, which are both installed as part of the developer tools in OS X 10.6.

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