【问题标题】:libpipeline fails to compile on Mac OS Xlibpipeline 无法在 Mac OS X 上编译
【发布时间】:2016-04-24 14:31:58
【问题描述】:

我正在尝试在 Mac OS X 上构建 libpipeline,但我遇到了其他使用 autotools 的程序没有遇到的错误。

这是我得到的第一个错误:

/Developer/usr/bin/ranlib: file: .libs/libgnu.a(sig-handler.o) has no symbols

第二个错误更神秘:

warning: /Developer/usr/bin/nm: no name list

最后,我得到了这个错误,推测这是以前错误的结果。

Undefined symbols for architecture x86_64:
  "_program_name", referenced from:
      _error in libgnu.a(error.o)
      _error_at_line in libgnu.a(error.o)
ld: symbol(s) not found for architecture x86_64

完整日志:https://gist.github.com/ahyattdev/7e4da95d48a6d25ad77aad926a14e7b0

重现步骤:获取libpipeline 1.4.1的源代码,运行configure; make

【问题讨论】:

  • 第一个不是错误,它是一个简单的信息性消息。但是,据我所知,OS X 不支持 libpipelinelibgnu
  • program_name 是外部符号。试试CFLAGS="-Wl,-flat_namespace,-undefined,suppress"
  • 这些论点为我解决了这个问题。然后引入了一个特定于库的问题,我用一个虚拟标题修复了这个问题。

标签: c macos autotools libtool gnulib


【解决方案1】:

This comment was the main contribution to this answer

配置命令:

CFLAGS="-Wl,-flat_namespace,-undefined,suppress -Iwindows.h" ./configure

出现一些与特定于 Windows 的标头有关的错误,但它只需要标头中的一些条目即可编译。

windows.h的内容(我放在项目根目录下)

typedef intptr_t;
#define INVALID_HANDLE_VALUE -1

这将允许项目成功构建。

【讨论】:

  • 这些标志似乎混淆了configure 脚本。它可能会导致二进制文件损坏。尝试将它们添加到 make 命令中:make CFLAGS="-Wl,-flat_namespace,-undefined,suppress"
  • @baf 你是对的,将这些标志传递给configure 会混淆它并导致二进制文件损坏。至少它为我做到了。将它们传递给make 似乎解决了这个问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-01-03
  • 2016-10-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多