You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the single include header (https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp) I get the following error during compilation error: expected initializer before ‘<’ token
in line 5323.
Sorry if it's an easy fix, I don't have much experience with C++.
I'm using g++ together with the latest CUDA compiler nvcc under WSL.
Edit: does not work using C++20, C++17 (probably below as well) compiles flawlessly
Reproduction steps
Include "json.hpp" in any header file
Expected vs. actual results
Expected: Successful compilation
Actual: No compilation
Same error. You might compile the program with nvcc as the default compiler. I have the same problem but can't find the solution. I used the 3.8.0 to avoid this problem.
Looking at this, it seems that support for ranges (a C++20 feature) is disabled on g++11. I have the issue above with nvcc12 and g++10.2.1. Maybe there should be more checks here? (I thought nvcc just used gcc's headers, so maybe it has nothing to do with CUDA/nvcc.)
In any case, I wanted to share the workaround of disabling ranges with
Description
When using the single include header (https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp) I get the following error during compilation
error: expected initializer before ‘<’ token
in line 5323.
Sorry if it's an easy fix, I don't have much experience with C++.
I'm using g++ together with the latest CUDA compiler nvcc under WSL.
Edit: does not work using C++20, C++17 (probably below as well) compiles flawlessly
Reproduction steps
Include "json.hpp" in any header file
Expected vs. actual results
Expected: Successful compilation
Actual: No compilation
Minimal code example
No response
Error messages
No response
Compiler and operating system
g++ (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0 | Cuda compilation tools, release 12.0, V12.0.76 Build cuda_12.0.r12.0/compiler.31968024_0
Library version
version 3.11.2
Validation
develop
branch is used.The text was updated successfully, but these errors were encountered: