2016-04-24 269 views
2

我试图在Mac OS X上构建libpipeline,但我遇到了其他使用autotools的程序时遇到的错误。libpipeline无法在Mac OS X上编译

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

/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

+1

第一个不是错误,它是一个简单的信息性消息。不过,据我所知,OS X上不支持'libpipeline'和'libgnu'。 – Leandros

+1

'program_name'是外部符号。尝试'CFLAGS =“ - Wl,-flat_namespace,-undefined,suppress”'。 – baf

+0

这些参数为我解决了这个问题。然后介绍了一个图书馆特定的问题,我用一个虚拟标题修复了这个问题。 – ahyattdev

回答

2

This comment was the main contribution to this answer

配置命令:

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

几个错误引起的相关的报头中特定的窗口,但只需要在头几个条目得到这个编译。

WINDOWS.H的内容(我把它放在项目的根)

typedef intptr_t; 
#define INVALID_HANDLE_VALUE -1 

这将使该项目成功打造。

+2

这些标志似乎混淆了'configure'脚本。它可能会导致破坏的二进制文件。尝试将它们添加到'make'命令中:'make CFLAGS =“ - Wl,-flat_namespace,-undefined,suppress”'。 – baf

+1

@baf你说得通过'configure'将这些标志混淆并导致破坏的二进制文件。至少对我来说是这样。把它们传递给make就好像解决了这个问题。 – GDP2