-
Notifications
You must be signed in to change notification settings - Fork 151
Description
Hello,
I'm trying to use json-schema-validator with Cmake for several days now but i'm stuck on undefined reference for the json_validator, at first i thought it was a linking issue.
This piece of cmake code
find_package(nlohmann_json_schema_validator REQUIRED)
if(TARGET nlohmann_json_schema_validator::validator)
message("nlohmann_json_schema_validator")
endif()
Finally convince that indeed the target name was nlohmann_json_schema_validator::validator and not just nlohmann_json_schema_validator as stated in the Readme.
But it did not solve my problem, the other strange thing that convinced my that it was no linking issue is that this line compile correctly :
nlohmann::json_schema::basic_error_handler handler;
So i guess the nlohmann_json_schema_validator is properly found and link (right ?).
But this one
nlohmann::json_schema::json_validator validator
Does not
I also tried with another ctor :
nlohmann::json_schema::json_validator validator(loader, nlohmann::json_schema::default_string_format_check);
With the same result :
undefined reference to `nlohmann::json_schema::json_validator::json_validator(std::function<void (nlohmann::json_uri const&, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >&)>, std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>, std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > const&)>)'
collect2: error: ld returned 1 exit status
Any ideas ?