Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added "config.h" because <config.h> wasn't found #2

Merged
merged 1 commit into from
Mar 13, 2014
Merged

added "config.h" because <config.h> wasn't found #2

merged 1 commit into from
Mar 13, 2014

Conversation

wsdookadr
Copy link

Was receiving this error, and so I included "config.h" in yaml_private.h

user@user-System-Product-Name:/tmp/yaml-libyaml-pm/YAML-LibYAML-0.41$ make
cp lib/YAML/XS.pm blib/lib/YAML/XS.pm
cp lib/YAML/LibYAML.pm blib/lib/YAML/LibYAML.pm
make[1]: Entering directory `/tmp/yaml-libyaml-pm/YAML-LibYAML-0.41/LibYAML'
cp lib/YAML/XS/LibYAML.pm ../blib/lib/YAML/XS/LibYAML.pm
cc -c  -I. -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"\" -DXS_VERSION=\"\" -fPIC "-I/home/user/perl5/perlbrew/perls/perl-5.18.2/lib/5.18.2/x86_64-linux/CORE"  -DHAVE_CONFIG_H api.c
api.c: In function 'yaml_get_version_string':
api.c:11:12: error: 'YAML_VERSION_STRING' undeclared (first use in this function)
api.c:11:12: note: each undeclared identifier is reported only once for each function it appears in
api.c: In function 'yaml_get_version':
api.c:21:14: error: 'YAML_VERSION_MAJOR' undeclared (first use in this function)
api.c:22:14: error: 'YAML_VERSION_MINOR' undeclared (first use in this function)
api.c:23:14: error: 'YAML_VERSION_PATCH' undeclared (first use in this function)
make[1]: *** [api.o] Error 1
make[1]: Leaving directory `/tmp/yaml-libyaml-pm/YAML-LibYAML-0.41/LibYAML'
make: *** [subdirs] Error 2

ingydotnet added a commit that referenced this pull request Mar 13, 2014
added "config.h" because <config.h> wasn't found
@ingydotnet ingydotnet merged commit a41d241 into ingydotnet:master Mar 13, 2014
@nicolasfranck
Copy link

On OSX the build fails due to a missing

#include "config.h"

in LibYAML/api.c

After that, the build starts perfectly.

cf. http://www.yasuhisay.info/entry/2016/01/05/210000

@nicolasfranck
Copy link

nicolasfranck commented Feb 12, 2018

Update: a config.h is found, but not the right one.

I noticed this during the build step:

cc -c  -I. -fno-common -DPERL_DARWIN -mmacosx-version-min=10.12 -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -I/opt/local/include -O3   -DVERSION=\"\" -DXS_VERSION=\"\"  "-I/Users/njfranck/.plenv/versions/5.22.0/lib/perl5/5.22.0/darwin-2level/CORE"  -DHAVE_CONFIG_H api.c

So the include directory

/Users/njfranck/.plenv/versions/5.22.0/lib/perl5/5.22.0/darwin-2level/CORE

also contains a file named config.h. That is a core configuration file for perl, I presume.
And that is the one that gets included, instead of config.h from your package.

Changing

#include <config.h>

to

#include "config.h"

in yaml_private.h would probably fix that

@perlpunk
Copy link
Collaborator

@nicolasfranck thanks, could you please open a new issue?
Since this is a PR, we can't re-open it, so it will not be listed in the issues or PR list...

@perlpunk
Copy link
Collaborator

might be related to yaml/libyaml#95

@nicolasfranck
Copy link

#82

Strange that this old pull request has been overwritten somehow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants