-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
GCC 7.5.0 with --std=c++17: filesystem: No such file or directory #3090
Comments
Oh dear - it seems we forgot about compilers that did not implement the standard completely... We'll check. |
Thank you, just ran into this myself! |
I am running into this same problem. If it's not already known, for some compilers (e.g. GCC 7.5) you have to do |
Yes, this is what #3101 is doing. Unfortunately, there are still tests failing with Clang 9. |
@nlohmann Yeah, I found that Issue after a little more digging. I plan on looking into it more today. |
The detection of whether or not |
try using a guard #if defined(_MSC_VER) && _MSC_VER < 1914 |
@bobluoluo That's already in #3101 |
- Ubuntu:18.04 has issues with c++17 and nlohmann_json (nlohmann/json#3090) - Added dos2unix to fix DOS line endings to enable building in Windows - Added CodeQL analysis
This can be useful when the compiler claims C++17 support, but standard library std::filesystem implementation is unavailable (MinGW) or can't be used because the current macOS target is too low to allow it (nlohmann#3156). See nlohmann#3090.
* upgrade the nlohmann_json from 3.7.3 to 3.10.4 to avoid variable conflict btw antlr-runtime 4.9.3 and nlohmann_json due to underspecified EOF without namespace After switching to the 4.9.3 runtime, encounter this conflict with our json parser. looking at it. details below: https://github.com/KatanaGraph/katana-enterprise/pull/2681#issuecomment-996016030 ``` /root/.conan/data/nlohmann_json/3.7.3/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/nlohmann/detail/input/binary_reader.hpp:17: 2021-12-16T16:53:42.4746873Z �[1m/root/.conan/data/nlohmann_json/3.7.3/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/nlohmann/detail/input/input_adapters.hpp:117:20: �[0m�[0;1;31merror: �[0m�[1muse of undeclared identifier 'EOF'; did you mean 'XPathLexer::EOF'?�[0m 2021-12-16T16:53:42.4754024Z if (res == EOF) 2021-12-16T16:53:42.4760480Z �[0;1;32m ^ 2021-12-16T16:53:42.4768646Z �[0m�[1m/root/.conan/data/antlr4-cppruntime/4.9.3/_/_/package/ed4c50cce248f963b530d644f4c27bd3c33aa7ed/include/antlr4-runtime/Recognizer.h:16:29: �[0m�[0;1;30mnote: �[0m'XPathLexer::EOF' declared here�[0m 2021-12-16T16:53:42.4775961Z static constexpr size_t EOF = std::numeric_limits<size_t>::max(); 2021-12-16T16:53:42.4782322Z �[0;1;32m ^ 2021-12-16T16:53:42.4787849Z �[0m1 error generated. 2021-12-16T16:53:42.4817761Z make[2]: *** [libquery/test/CMakeFiles/antlr-parser-test.dir/build.make:76: libquery/test/CMakeFiles/antlr-parser-test.dir/antlr-test.cpp.o] Error 1 2021-12-16T16:53:42.4829423Z make[1]: *** [CMakeFiles/Makefile2:8418: libquery/test/CMakeFiles/antlr-parser-test.dir/all] Error 2 ``` https://github.com/nlohmann/json/blob/v3.7.3/include/nlohmann/detail/input/input_adapters.hpp#L117 Looks like it is fixed in latest(3.10.4) json parser: https://github.com/nlohmann/json/blob/v3.10.4/include/nlohmann/detail/input/input_adapters.hpp#L112 * 3.10.4 has known unsolved issue: nlohmann/json#3090
Using |
What is the issue you have?
Compilation fails using GCC 7.5.0 (default GCC compiler version in ubuntu 18.04) for a target which has --std=c++17 compiler option.
Please describe the steps to reproduce the issue.
GCC 7.5.0 declares: __cplusplus = 201703L, thus JSON_HAS_CPP_17 flag is set but in fact GCCv7 implements <experimental/filesystem>
https://stackoverflow.com/questions/45867379/why-does-gcc-not-seem-to-have-the-filesystem-standard-library
Can you provide a small but working code example?
See diff (to test project's CMakeLists.txt) at the end of bug report.
What is the expected behavior?
Compilation of json.hpp should work with GCCv7 with --std=c++17 compiler option.
And what is the actual behavior instead?
Compilation using GCCv7 outputs errors:
Which compiler and operating system are you using?
Which version of the library did you use?
develop
branchIf you experience a compilation error: can you compile and run the unit tests?
Compilation fails, if I make following change:
The text was updated successfully, but these errors were encountered: