iconv 例程被转换为 libiconv_ 名称并且无法在 OS X 上链接

发布于 2024-10-09 14:23:29 字数 410 浏览 3 评论 0原文

我正在尝试在 Mac OS X 10.6 上从最新的 Subversion 构建 Hercules。它使用 iconv 库进行字符翻译。 Hercules 代码使用 iconv_open()、 iconv() 和 iconv_close()。这些例程也以这些名称存在于 10.6 的系统库中。只有一个问题:我遇到 libiconv_open()、libiconv() 和 libiconv_close() 的链接失败。

我在我的系统中寻找名称从 iconv* 更改为 libiconv* 的地方,但没有找到任何东西。 Hercules 代码中没有任何内容执行此操作。其他人能够在当前的 OS X 上构建良好的版本。

我缺少一些简单的东西,但就是找不到它。帮助?

I'm trying to build Hercules from the latest Subversion on Mac OS X 10.6. It uses the iconv library for character translations. The Hercules code uses iconv_open(), iconv(), and iconv_close(). Those routines are also present in the system library on 10.6, under those names. There's only one problem: I'm getting link failures for libiconv_open(), libiconv(), and libiconv_close().

I've hunted all over my system for where the names are being changed from iconv* to libiconv*, and not found a thing. Nothing in the Hercules code is doing this. Other folks are able to build fine on current OS X.

I'm missing something simple, but just can't find it. Help?

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

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

发布评论

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

评论(2

同展鸳鸯锦 2024-10-16 14:23:29

我得到了这个:

checking for iconv_open in -liconv... yes
checking for iconv... yes
....
Undefined symbols:
  "_libiconv_open", referenced from:
      _SDL_iconv_string in SDL_iconv.o
      _SDL_iconv_string in SDL_iconv.o
  "_libiconv", referenced from:
      _SDL_iconv in SDL_iconv.o
      _SDL_iconv_string in SDL_iconv.o
  "_libiconv_close", referenced from:
      _SDL_iconv_string in SDL_iconv.o
      _SDL_iconv_string in SDL_iconv.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [build/libSDL.la] Error 1

直到我删除了 /opt/local 和 /usr/local 中的另外两个副本(来自 Macports 和 GNU 软件包的原始版本)。然后就成功了。

I got this:

checking for iconv_open in -liconv... yes
checking for iconv... yes
....
Undefined symbols:
  "_libiconv_open", referenced from:
      _SDL_iconv_string in SDL_iconv.o
      _SDL_iconv_string in SDL_iconv.o
  "_libiconv", referenced from:
      _SDL_iconv in SDL_iconv.o
      _SDL_iconv_string in SDL_iconv.o
  "_libiconv_close", referenced from:
      _SDL_iconv_string in SDL_iconv.o
      _SDL_iconv_string in SDL_iconv.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [build/libSDL.la] Error 1

until I removed my two other copies in /opt/local and /usr/local (from Macports and a raw build of the GNU package). Then it worked.

给妤﹃绝世温柔 2024-10-16 14:23:29

有点晚了,在我的例子中,下面的行做到了(MacOS X 10.8.4):

CFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/' LDFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/ -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/' ./configure

我必须重写自动工具 LDFLAGS 来告诉配置脚本使用 XCode SDK 附带的库。

Beeing a bit late, in my case the following line did it (MacOS X 10.8.4):

CFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/' LDFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/ -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/' ./configure

I had to override the autotools LDFLAGS to tell the configure script to use the libraries shipped with the XCode SDK.

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