json-schema-validator icon indicating copy to clipboard operation
json-schema-validator copied to clipboard

report error LNK2019 when using visual studio 2019 in windows server 2022

Open jianweihao opened this issue 7 months ago • 0 comments

env

  • windows server 2022
  • visual studio 2019

code

  • use cmake and conan to build the project
  • config in conanfile.py json-schema-validator/2.1.0 nlohmann_json/3.10.5

error report

1> main.obj : error LNK2019: unresolved external symbol "public: __cdecl nlohmann::json_schema::json_validator::json_validator(class std::function<void __cdecl(class nlohmann::json_uri const &,class nlohmann::basic_json<class std::map,class std::vector,class std::basic_string<char,struct std::char_traits,class std::allocator >,bool,__int64,unsigned __int64,double,class std::allocator,struct nlohmann::adl_serializer,class std::vector<unsigned char,class std::allocator > > &)>,class std::function<void __cdecl(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)>)" (??0json_validator@json_schema@nlohmann@@QEAA@V?$function@A6AXAEBVjson_uri@nlohmann@@AEAV?$basic_json@Vmap@std@@Vvector@2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@_N_J_KNVallocator@2@Uadl_serializer@nlohmann@@V?$vector@EV?$allocator@E@std@@@2@@2@@Z@std@@V?$function@A6AXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z@4@@Z), referenced in function main 1> main.obj : error LNK2019: unresolved external symbol "public: void __cdecl nlohmann::json_schema::json_validator::set_root_schema(class nlohmann::basic_json<class std::map,class std::vector,class std::basic_string<char,struct std::char_traits,class std::allocator >,bool,__int64,unsigned __int64,double,class std::allocator,struct nlohmann::adl_serializer,class std::vector<unsigned char,class std::allocator > > const &)" (?set_root_schema@json_validator@json_schema@nlohmann@@QEAAXAEBV?$basic_json@Vmap@std@@Vvector@2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@_N_J_KNVallocator@2@Uadl_serializer@nlohmann@@V?$vector@EV?$allocator@E@std@@@2@@3@@Z), referenced in function main 1> main.obj : error LNK2019: unresolved external symbol "public: class nlohmann::basic_json<class std::map,class std::vector,class std::basic_string<char,struct std::char_traits,class std::allocator >,bool,__int64,unsigned __int64,double,class std::allocator,struct nlohmann::adl_serializer,class std::vector<unsigned char,class std::allocator > > __cdecl nlohmann::json_schema::json_validator::validate(class nlohmann::basic_json<class std::map,class std::vector,class std::basic_string<char,struct std::char_traits,class std::allocator >,bool,__int64,unsigned __int64,double,class std::allocator,struct nlohmann::adl_serializer,class std::vector<unsigned char,class std::allocator > > const &)const " (?validate@json_validator@json_schema@nlohmann@@QEBA?AV?$basic_json@Vmap@std@@Vvector@2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@_N_J_KNVallocator@2@Uadl_serializer@nlohmann@@V?$vector@EV?$allocator@E@std@@@2@@3@AEBV43@@Z), referenced in function main 1> C:\Users\cloud\source\repos\TestJsonSchema\x64\Debug\TestJsonSchema.exe : fatal error LNK1120: 3 unresolved external commands

try to solve

  • i had tried this config to solve, but why is it that only this config can resolve the issue? json-schema-validator/2.3.0 nlohmann_json/3.11.3

fail config

  • json-schema-validator/2.0.0、nlohmann_json/3.10.5
  • json-schema-validator/2.1.0、nlohmann_json/3.10.5
  • json-schema-validator/2.2.0、nlohmann_json/3.10.5
  • json-schema-validator/2.3.0、nlohmann_json/3.10.5
  • json-schema-validator/2.1.0、nlohmann_json/3.11.3
  • json-schema-validator/2.2.0、nlohmann_json/3.11.3

jianweihao avatar May 12 '25 08:05 jianweihao