Building the latest ruby fails: use of undeclared identifier 'YAML_VERSION_*'

StackOverflow https://stackoverflow.com/questions/21286206

  •  01-10-2022
  •  | 
  •  

Вопрос

Building the latest Ruby on OSX fails:

../.././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;

Why is this the case? Isn't the source tested?

Это было полезно?

Решение

This is fixed by adding #include "config.h" to ...yaml/api.c.

But then there arise other, different errors later.

I can't understand why incorrect source code is published by the ruby developers.

Edit with more information:

It seems that certain defines are missing (failure by configure?). The other errors were fixed by adding

#define HAVE_IFADDRS_H 1
#define HAVE_NET_IF_H 1

to ext/socket/rubysocket.h. After these fixes the compilation ran fine.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top