2015-10-17 67 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