2015-10-17 93 views
1

我試圖編譯LIRC最新(0.9.3.a)​​在OSX 10.10,配置是成功的,但是做失敗了幾次:編譯在OSX 10.10 MAKE LIRC失敗

lircd.cpp:748:6: error: no matching function for call to 'getgrouplist' 
     r = getgrouplist(user, pw->pw_gid, groups, &group_cnt); 
      ^~~~~~~~~~~~ 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/unistd.h:648:6: note: candidate function not viable: no known conversion from 'gid_t [32]' to 'int *' for 3rd argument 
int  getgrouplist(const char *, int, int *, int *); 

如果我註釋掉問題的代碼,並再次運行,我得到:

irexec.cpp:62:3: error: use of undeclared identifier 'strdupa'; did you mean 'strdup'? 
       strdupa(SH_PATH), strdupa("-c"), strdupa(cmd), NULL 
       ^~~~~~~ 
       strdup 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/string.h:117:7: note: 'strdup' declared here 
char *strdup(const char *); 

如果我改變strupa到strup,那麼接下來的失敗是:

In file included from irpipe.cpp:17: 
../drivers/irpipe/irpipe.h:3:10: fatal error: 'asm-generic/ioctl.h' file not found 
#include <asm-generic/ioctl.h> 

現在我知道只是註釋掉代碼並不能解決問題,但是我不是C程序員,而且我想知道如果我註釋掉代碼會得到多少。

我也嘗試編譯以前的版本,他們也失敗了。

關於如何解決這些問題的任何建議?

回答

0

老問題,但如果它可以幫助別人......

configure.ac在0.9.4b仍然有這個問題。解決方案很簡單:

diff --git a/configure.ac b/configure.ac 
index 81dece0..ed38bf6 100644 
--- a/configure.ac 
+++ b/configure.ac 
@@ -346,6 +346,7 @@ CFLAGS="-Werror -Wall" 
AC_COMPILE_IFELSE([ 
    AC_LANG_SOURCE([ 
    #include <grp.h> 
+ #include <unistd.h> 
    int main(int argc, char**argv) 
    { 
     int groups[[4]]; 
0

上面的修復不足以使它構建。 LIRC也受到投票中的蘋果漏洞的影響,目前正在努力解決這個問題。觀看上游版本0_9_4分支以獲取最新修復。

+0

「修正以上」應爲「修復之下」,對不起 – leamas

+0

您可以自由[編輯]你的答案解決的事情。 – Tsyvarev

0

這應該是在最新版本LIRC 0.9.4c

+0

這不提供問題的答案。一旦你有足夠的[聲譽](http://stackoverflow.com/help/whats-reputation),你將能夠[評論任何職位](http://stackoverflow.com/help/privileges/comment);相反,[提供不需要提問者澄清的答案](http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-c​​an- I-DO-代替)。 - [來自評論](/ review/low-quality-posts/14063221) – etienne

+0

@etienne不同意這是低質量。這可能是不正確的,但如果是的話,這將是一個有效的答案。也就是說,leamas應該擴展答案並提供升級說明,幷包含相關錯誤報告/補丁/發行說明的鏈接或摘錄。 – brandonscript