【问题标题】:Building the latest ruby fails: use of undeclared identifier 'YAML_VERSION_*'构建最新的 ruby​​ 失败:使用未声明的标识符 'YAML_VERSION_*'
【发布时间】:2014-02-12 16:54:18
【问题描述】:

在 OSX 上构建最新的 Ruby 失败:

../.././ext/psych/yaml/api.c:11:12: error: use of undeclared identifier 'YAML_VERSION_STRING'
    return YAML_VERSION_STRING;
           ^
../.././ext/psych/yaml/api.c:21:14: error: use of undeclared identifier 'YAML_VERSION_MAJOR'
    *major = YAML_VERSION_MAJOR;
             ^
../.././ext/psych/yaml/api.c:22:14: error: use of undeclared identifier 'YAML_VERSION_MINOR'
    *minor = YAML_VERSION_MINOR;
             ^
../.././ext/psych/yaml/api.c:23:14: error: use of undeclared identifier 'YAML_VERSION_PATCH'
    *patch = YAML_VERSION_PATCH;

为什么会这样?源码没测试吗?

【问题讨论】:

    标签: ruby macos ruby-2.1


    【解决方案1】:

    通过将#include "config.h" 添加到...yaml/api.c 来解决此问题。

    但随后会出现其他不同的错误。

    我不明白为什么 ruby​​ 开发人员发布了不正确的源代码。

    编辑更多信息:

    似乎缺少某些定义(配置失败?)。其他错误已通过添加修复

    #define HAVE_IFADDRS_H 1
    #define HAVE_NET_IF_H 1
    

    ext/socket/rubysocket.h。在这些修复之后,编译运行良好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多