2016-04-24 270 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