1

我正在尝试在 osx 10.10 上编译 lirc latest (0.9.3.a),配置成功,但是 make 多次失败:

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 程序员,我想看看如果我注释掉代码会走多远。

我也试过编译以前的版本,他们也失败了。

关于如何解决这些问题的任何建议?

4

3 回答 3

0

上面的修复不足以使其构建。LIRC 也受到 poll() 中的苹果错误的影响,正在努力解决这个问题。观看上游 release-0_9_4 分支以获取最新修复。

于 2016-10-17T12:15:10.220 回答
0

这应该在最新的 LIRC 版本 0.9.4c 中修复

于 2016-10-22T08:10:13.767 回答
0

老问题,但如果它对某人有帮助......

0.9.4b 中的 configure.ac 仍然有这个问题。解决方案很简单:

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]];
于 2016-10-03T01:50:50.427 回答