c - libpipeline 在 Mac OS X 上编译失败

标签 c macos autotools libtool gnulib

我尝试在 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;制作

最佳答案

This comment was the main contribution to this answer

配置命令:

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

出现一些与特定于 Windows 的 header 相关的错误,但只需要 header 中的几个条目即可对其进行编译。

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

typedef intptr_t;
#define INVALID_HANDLE_VALUE -1

这将使项目能够成功构建。

关于c - libpipeline 在 Mac OS X 上编译失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36824434/

相关文章:

swift - NSPageController,如果animator()处使用了selectedIndex,autoresizingMask没有效果

cocoa - 如何在 Cocoa AppKit 应用程序中实现缩放/缩放

iphone - 将 Apache Portable Runtime 交叉编译到 iPhone

android - 如何使有关 undefined reference 的错误日志更详细

C 程序停止使用 scanf_s

c - 消息的 Adler32 + adler 总和是否为零(如 CRC32)

Autotools:top_srcdir 和 abs_top_srcdir 为空

c++ - C 和 C++ 中的可变长度数组 (VLA)

ruby - 在 Ruby 中如何检测文件是否可写?

build-process - 使用 cmake 中的 autotools 构建库