Skip to content

How can i build this library in VS 2017? #1943

Description

@dota17
  • Describe what you want to achieve.
    I know i can use single_include in my project, but i want to build and test this library in VS 2017, especially i add my code.

  • Describe what you tried.
    In VS 2017, i open this library as CMake Project with File - Open - CMake....
    And then, CMake - Build All.

But i got these error:

.\json-develop\test\src\unit-udt.cpp : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss 
.\json-develop\test\src\unit-udt.cpp(115): error C2001: newline in constant 
.\json-develop\test\src\unit-udt.cpp(202): error C2001: newline in constant 
.\json-develop\test\src\unit-udt.cpp(276): error C2672: 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>::get': no matching overloaded function found 
.\json-develop\test\src\unit-udt.cpp(276): error C2783: 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer> nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>::get(void) const': could not deduce template argument for '__formal' 
    .\json-develop\single_include\nlohmann\json.hpp(17101): note: see declaration of 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>::get'
.\json-develop\test\src\unit-udt.cpp(276): error C2789: 'parsed_book': an object of const-qualified type must be initialized 
    .\json-develop\test\src\unit-udt.cpp(276): note: see declaration of 'parsed_book'
.\json-develop\test\src\unit-udt.cpp(279): error C2672: 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>::get': no matching overloaded function found 
.\json-develop\test\src\unit-udt.cpp(279): error C2783: 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer> nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>::get(void) const': could not deduce template argument for '__formal' 
    .\json-develop\single_include\nlohmann\json.hpp(17101): note: see declaration of 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>::get'
.\json-develop\test\src\unit-udt.cpp(278): error C2789: 'contacts': an object of const-qualified type must be initialized 
    .\json-develop\test\src\unit-udt.cpp(278): note: see declaration of 'contacts'
.\json-develop\test\src\unit-udt.cpp(281): error C2672: 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>::get': no matching overloaded function found 
.\json-develop\test\src\unit-udt.cpp(281): error C2783: 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer> nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>::get(void) const': could not deduce template argument for '__formal' 
    .\json-develop\single_include\nlohmann\json.hpp(17101): note: see declaration of 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>::get'

Also, these error is similar to #664 (comment)

  • Describe which system (OS, compiler) you are using.
    Windows 10

  • Describe which version of the library you are using (release version, develop branch).
    -- Building for: Visual Studio 15 2017
    -- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18362.
    -- The CXX compiler identification is MSVC 19.16.27035.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions