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

#include <filesystem> doesn't work with gcc-7 when -std=c++17 is specified. #3203

Closed
1 of 2 tasks
sighingnow opened this issue Dec 21, 2021 · 1 comment · Fixed by #3101
Closed
1 of 2 tasks

#include <filesystem> doesn't work with gcc-7 when -std=c++17 is specified. #3203

sighingnow opened this issue Dec 21, 2021 · 1 comment · Fixed by #3101
Labels
confirmed kind: bug release item: 🐛 bug fix solution: duplicate the issue is a duplicate; refer to the linked issue instead solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@sighingnow
Copy link

sighingnow commented Dec 21, 2021

What is the issue you have?

GCC 7 (on Ubuntu 18.04) doesn't have <filesystem>, instead, it has <experimental/filesystem> with namespace std::experimental::filesystem. When -std=c++17 is specified on Ubuntu 18.04 with GCC-7, this library fails to compile, as

#ifdef JSON_HAS_CPP_17
#include <filesystem>
#endif

doesn't work. The inclusion for <filesystem> requires more care with GCC.

If you experience a compilation error: can you compile and run the unit tests?

  • yes
  • no - please copy/paste the error message below
/home/runner/work/v6d/v6d/thirdparty/nlohmann-json/include/nlohmann/detail/conversions/from_json.hpp:23:14: fatal error: filesystem: No such file or directory
     #include <filesystem>
              ^~~~~~~~~~~~
compilation terminated.
@nlohmann
Copy link
Owner

Duplicate of #3090. To be fixed with #3101. Sorry for the inconvenience.

@nlohmann nlohmann added the solution: duplicate the issue is a duplicate; refer to the linked issue instead label Dec 21, 2021
@nlohmann nlohmann linked a pull request Dec 21, 2021 that will close this issue
@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Dec 28, 2021
@nlohmann nlohmann added this to the Release 3.10.5 milestone Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed kind: bug release item: 🐛 bug fix solution: duplicate the issue is a duplicate; refer to the linked issue instead solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants