Closed Memhir-Yasue closed 5 years ago
This means that you did not add the directory containing nlohmann
in your compiler options as a system include directory. The <foo.h>
syntax generally means "search in system include directories" while "foo.h"
means "search in system include directories and the directory of the file doing the include".
@gregmarr is right. Furthermore, there are several package managers which all assume this way of including. As a working example, see the compiler call on the bottom of https://nlohmann.github.io/json/classnlohmann_1_1basic__json_a8faa039ca82427ed29c486ffd00600c3.html#a8faa039ca82427ed29c486ffd00600c3
Gotcha! Thanks for the explanations! Learned something new!
Hello, I declared the header file as
#include <nlohmann/json.hpp>
as the documentation suggested.However, I ran into the following problem when complying
I found this issue from 2017 which suggests to instead use
#include "nlohmann/json.hpp"
https://github.com/melpon/wandbox/issues/209No errors encountered afterwards when complying.
Using Ubuntu 18.04.02 with GCC 7.3.0