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

libconfig 1.5 not compiling - Windows 10, Visual Studio 2013 #65

Closed
prechtl opened this issue May 23, 2016 · 2 comments
Closed

libconfig 1.5 not compiling - Windows 10, Visual Studio 2013 #65

prechtl opened this issue May 23, 2016 · 2 comments

Comments

@prechtl
Copy link

prechtl commented May 23, 2016

Since Version 1.7 won't build due to it's use of dirent.h, I tried to download the v1.5 tarball and build that in Visual Studio. The build is failing with the error:
libconfig.obj : error LNK2019: unresolved external symbol S_ISDIR referenced in function config_read_file

Apparently S_ISDIR is a posix macros and does not work on Windows. Is there libconfig source that will build on Windows?

@hyperrealm
Copy link
Owner

I'll fix that ASAP. In the meantime you can just add these lines to 'wincompat.h', after the first #if in that file.

#if !defined(S_ISDIR) && defined(S_IFMT) && defined(S_IFDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif

@prechtl
Copy link
Author

prechtl commented May 24, 2016

Thanks - that worked.

(I just had to adjust one other line in example1.cpp, changing line 58 to read:
string name = cfg.lookup("name").c_str();
And then everything in libconfig compiled)

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

No branches or pull requests

2 participants