我尝试在 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/