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
That the file compiles (which it does when I include json.hpp instead of json_fwd.hpp in the header file).
And what is the actual behavior instead?
$ g++ test.cpp
In file included from test.cpp:1:
test.h:10:10: error: field ‘foo’ has incomplete type ‘json’ {aka ‘nlohmann::basic_json<>’}
json foo;
^~~
In file included from test.h:4,
from test.cpp:1:
/usr/include/nlohmann/json_fwd.hpp:37:7: note: declaration of ‘using json = using json = class nlohmann::basic_json<>’ {aka ‘class nlohmann::basic_json<>’}
class basic_json;
^~~~~~~~~~
Which compiler and operating system are you using? Is it a supported compiler?
gcc 8.2.0 on Debian Linux.
Did you use a released version of the library or the version from the develop branch?
When I change
#include <nlohmann/json.hpp>
to<nlohmann/json_fwd.hpp>
in my header (and include json.hpp in my cpp file), it no longer compiles.test.h:
test.cpp
That the file compiles (which it does when I include json.hpp instead of json_fwd.hpp in the header file).
gcc 8.2.0 on Debian Linux.
develop
branch?Release 3.2.0.
100% tests passed, 0 tests failed out of 80
The text was updated successfully, but these errors were encountered: