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

Issue with including <version> #4241

Closed
2 tasks
oleg-alexandrov opened this issue Dec 12, 2023 · 2 comments
Closed
2 tasks

Issue with including <version> #4241

oleg-alexandrov opened this issue Dec 12, 2023 · 2 comments

Comments

@oleg-alexandrov
Copy link

oleg-alexandrov commented Dec 12, 2023

Description

I ran into a compilation problem for some software using this library which was triggered by this line:

https://github.com/nlohmann/json/blob/3780b41dd070436f3f55327b0a88f27a52e2dfa8/include/nlohmann/detail/macro_scope.hpp#L52C18-L52C18

which says: #include

It was including some unrelated file. I guess both that package and json itself were using "version" for their own thing. This software should search instead "json_version" or something, and that other package should have its own convention, I guess.

Reproduction steps

At the base of a conda environment create a file called "version". Then this library will try to include it and will fail. This may require setting some compiler include flags. The point here that it is fragile logic to count on a file called "version" to be the thing one thinks of as "version".

Expected vs. actual results

I expected json to compile, but it failed.

Minimal code example

No response

Error messages

No response

Compiler and operating system

Linux

Library version

3.11.2

Validation

@gregmarr
Copy link
Contributor

The <version> header is part of standard C++, so it's the other library that will need to be fixed.
https://en.cppreference.com/w/cpp/header/version

@oleg-alexandrov
Copy link
Author

Can't argue with the standard library, I guess. Thank you. I will close this.

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

No branches or pull requests

2 participants