Skip to content

MSVC 2015 update 2 #469

Closed
Closed

Description

@RiccardoRossi

Hello,

i wanted to know if there is any possibility of using the library with visual studio 2015 UPDATE 2.

Think is that update 3 is not viable for us, since boost.python is broken.

regards
Riccardo

Activity

  1. nlohmann commented on Feb 23, 2017

    @nlohmann
    Owner

    I do not know. We use MSVC 19.0.24215.1 in the unit tests on AppVeyor (see https://ci.appveyor.com/project/nlohmann/json for the latest build result). Did you try? What error message did you get?

  2. RiccardoRossi commented on Feb 23, 2017

    @RiccardoRossi
    Author

    Hi, my colleague Pooyan Dadvant will be posting the error.

  3. pooyan-dadvand commented on Feb 23, 2017

    @pooyan-dadvand

    Just to share the error I got while compiling it with my VS build 14.023107.0

    1>C:\Kratos\external_libraries\json/json.hpp(887): error C4579: 'nlohmann::detail::static_constnlohmann::detail::to_json_fn::value': in-class initialization for type 'const T' is not yet implemented; static member will remain uninitialized at runtime but use in constant-expressions is supported
    1> with
    1> [
    1> T=nlohmann::detail::to_json_fn
    1> ]
    1> C:\Kratos\external_libraries\json/json.hpp(898): note: see reference to class template instantiation 'nlohmann::detail::static_constnlohmann::detail::to_json_fn' being compiled
    1>C:\Kratos\external_libraries\json/json.hpp(887): error C2131: expression did not evaluate to a constant
    1> C:\Kratos\external_libraries\json/json.hpp(887): note: failure was caused by returning the address of or a reference to a temporary
    1>C:\Kratos\external_libraries\json/json.hpp(887): error C4579: 'nlohmann::detail::static_constnlohmann::detail::from_json_fn::value': in-class initialization for type 'const T' is not yet implemented; static member will remain uninitialized at runtime but use in constant-expressions is supported
    1> with
    1> [
    1> T=nlohmann::detail::from_json_fn
    1> ]
    1> C:\Kratos\external_libraries\json/json.hpp(899): note: see reference to class template instantiation 'nlohmann::detail::static_constnlohmann::detail::from_json_fn' being compiled
    1>C:\Kratos\external_libraries\json/json.hpp(6482): error C2784: '_Ty *std::begin(_Ty (&)[_Size]) noexcept': could not deduce template argument for '_Ty (&)[_Size]' from 'add_rvalue_reference::type'
    1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xutility(1250): note: see declaration of 'std::begin'
    1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits(761): note: see reference to class template instantiation 'nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer' being compiled
    1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits(790): note: see reference to class template instantiation 'std::is_nothrow_constructible<_Ty,nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer &&>' being compiled
    1> with
    1> [
    1> _Ty=nlohmann::json
    1> ]
    1> C:\Kratos\external_libraries\json/json.hpp(12912): note: see reference to class template instantiation 'std::is_nothrow_move_constructiblenlohmann::json' being compiled
    1>C:\Kratos\external_libraries\json/json.hpp(6482): error C2893: Failed to specialize function template 'unknown-type std::begin(const _Container &)'
    1> C:\Kratos\external_libraries\json/json.hpp(6482): note: With the following template arguments:
    1> C:\Kratos\external_libraries\json/json.hpp(6482): note: '_Container=add_rvalue_reference::type'
    1>C:\Kratos\external_libraries\json/json.hpp(6482): error C2893: Failed to specialize function template 'unknown-type std::begin(_Container &)'
    1> C:\Kratos\external_libraries\json/json.hpp(6482): note: With the following template arguments:
    1> C:\Kratos\external_libraries\json/json.hpp(6482): note: '_Container=add_rvalue_reference::type'
    1>C:\Kratos\external_libraries\json/json.hpp(6482): error C2784: 'const _Elem *std::begin(std::initializer_list<_Elem>) noexcept': could not deduce template argument for 'std::initializer_list<_Elem>' from 'add_rvalue_reference::type'
    1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\initializer_list(60): note: see declaration of 'std::begin'
    1>C:\Kratos\kratos\includes/kratos_parameters.h(174): error C2665: 'nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer::parse': none of the 2 overloads could convert all the argument types
    1> C:\Kratos\external_libraries\json/json.hpp(6361): note: could be 'nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer::parse(std::istream &&,const std::function<bool (int,nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer::parse_event_t,nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer &)>)'
    1> C:\Kratos\external_libraries\json/json.hpp(6352): note: or 'nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer::parse(std::istream &,const std::function<bool (int,nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer::parse_event_t,nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer &)>)'
    1> C:\Kratos\kratos\includes/kratos_parameters.h(174): note: while trying to match the argument list '(const std::string)'
    1>C:\Kratos\kratos\includes/kratos_parameters.h(183): error C2665: 'nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer::parse': none of the 2 overloads could convert all the argument types
    1> C:\Kratos\external_libraries\json/json.hpp(6361): note: could be 'nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer::parse(std::istream &&,const std::function<bool (int,nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer::parse_event_t,nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer &)>)'
    1> C:\Kratos\external_libraries\json/json.hpp(6352): note: or 'nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer::parse(std::istream &,const std::function<bool (int,nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer::parse_event_t,nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer &)>)'
    1> C:\Kratos\kratos\includes/kratos_parameters.h(183): note: while trying to match the argument list '(const std::string)'
    1>C:\Kratos\kratos\includes/kratos_parameters.h(188): error C2665: 'nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer::parse': none of the 2 overloads could convert all the argument types
    1> C:\Kratos\external_libraries\json/json.hpp(6361): note: could be 'nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer::parse(std::istream &&,const std::function<bool (int,nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer::parse_event_t,nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer &)>)'
    1> C:\Kratos\external_libraries\json/json.hpp(6352): note: or 'nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer::parse(std::istream &,const std::function<bool (int,nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer::parse_event_t,nlohmann::basic_jsonstd::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer &)>)'
    1> C:\Kratos\kratos\includes/kratos_parameters.h(188): note: while trying to match the argument list '(const std::string)'

  4. nlohmann commented on Feb 23, 2017

    @nlohmann
    Owner

    Thanks. Could you compile the unit tests?

  5. pooyan-dadvand commented on Feb 23, 2017

    @pooyan-dadvand

    I have try to compile the unit testing with a clone of the current repository version and gives me the same compilation error.

  6. nlohmann commented on Feb 23, 2017

    @nlohmann
    Owner

    Could you please post the error from compiling the unit tests as well, because then we have the complete picture where the error first occurs.

    Well, I am no expert in MSVC. It seems as if AppVeyor is using a slightly more modern version (just comparing the build version numbers). Is that Update 3?

  7. pooyan-dadvand commented on Feb 24, 2017

    @pooyan-dadvand

    The update 3 is more modern but it is incompatible with boost library which we are using....
    I will send you the error when I arrive to my office

  8. pooyan-dadvand commented on Feb 24, 2017

    @pooyan-dadvand

    here you have the output:

    1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
    2>------ Skipped Build: Project: RUN_TESTS, Configuration: Debug Win32 ------
    2>Project not selected to build for this solution configuration 
    1>  Checking Build System
    1>  CMake does not need to re-run because C:/Temp/json-develop/build/CMakeFiles/generate.stamp is up-to-date.
    1>  CMake does not need to re-run because C:/Temp/json-develop/build/test/CMakeFiles/generate.stamp is up-to-date.
    3>------ Build started: Project: catch_main, Configuration: Debug Win32 ------
    4>------ Skipped Build: Project: clean_cotire, Configuration: Debug Win32 ------
    4>Project not selected to build for this solution configuration 
    3>  Building Custom Rule C:/Temp/json-develop/test/CMakeLists.txt
    3>  CMake does not need to re-run because C:\Temp\json-develop\build\test\CMakeFiles\generate.stamp is up-to-date.
    3>  unit.cpp
    3>  catch_main.vcxproj -> C:\Temp\json-develop\build\test\catch_main.dir\Debug\catch_main.lib
    5>------ Build started: Project: json_unit, Configuration: Debug Win32 ------
    5>  Building Custom Rule C:/Temp/json-develop/test/CMakeLists.txt
    5>  CMake does not need to re-run because C:\Temp\json-develop\build\test\CMakeFiles\generate.stamp is up-to-date.
    5>  Generating CXX prefix header C:\Temp\json-develop\build\test\Debug\cotire\json_unit_CXX_prefix.hxx
    5>  unit-algorithms.cpp
    5>C:\Temp\json-develop\src\json.hpp(887): error C4579: 'nlohmann::detail::static_const<nlohmann::detail::to_json_fn>::value': in-class initialization for type 'const T' is not yet implemented; static member will remain uninitialized at runtime but use in constant-expressions is supported
    5>          with
    5>          [
    5>              T=nlohmann::detail::to_json_fn
    5>          ]
    5>  C:\Temp\json-develop\src\json.hpp(898): note: see reference to class template instantiation 'nlohmann::detail::static_const<nlohmann::detail::to_json_fn>' being compiled
    5>C:\Temp\json-develop\src\json.hpp(887): error C2131: expression did not evaluate to a constant
    5>  C:\Temp\json-develop\src\json.hpp(887): note: failure was caused by returning the address of or a reference to a temporary
    5>C:\Temp\json-develop\src\json.hpp(887): error C4579: 'nlohmann::detail::static_const<nlohmann::detail::from_json_fn>::value': in-class initialization for type 'const T' is not yet implemented; static member will remain uninitialized at runtime but use in constant-expressions is supported
    5>          with
    5>          [
    5>              T=nlohmann::detail::from_json_fn
    5>          ]
    5>  C:\Temp\json-develop\src\json.hpp(899): note: see reference to class template instantiation 'nlohmann::detail::static_const<nlohmann::detail::from_json_fn>' being compiled
    5>C:\Temp\json-develop\src\json.hpp(6482): error C2784: '_Ty *std::begin(_Ty (&)[_Size]) noexcept': could not deduce template argument for '_Ty (&)[_Size]' from 'add_rvalue_reference<const ContiguousContainer>::type'
    5>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xutility(1250): note: see declaration of 'std::begin'
    5>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits(761): note: see reference to class template instantiation 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>' being compiled
    5>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits(790): note: see reference to class template instantiation 'std::is_nothrow_constructible<_Ty,nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer> &&>' being compiled
    5>          with
    5>          [
    5>              _Ty=nlohmann::json
    5>          ]
    5>  C:\Temp\json-develop\src\json.hpp(12931): note: see reference to class template instantiation 'std::is_nothrow_move_constructible<nlohmann::json>' being compiled
    5>C:\Temp\json-develop\src\json.hpp(6482): error C2893: Failed to specialize function template 'unknown-type std::begin(const _Container &)'
    5>  C:\Temp\json-develop\src\json.hpp(6482): note: With the following template arguments:
    5>  C:\Temp\json-develop\src\json.hpp(6482): note: '_Container=add_rvalue_reference<const ContiguousContainer>::type'
    5>C:\Temp\json-develop\src\json.hpp(6482): error C2893: Failed to specialize function template 'unknown-type std::begin(_Container &)'
    5>  C:\Temp\json-develop\src\json.hpp(6482): note: With the following template arguments:
    5>  C:\Temp\json-develop\src\json.hpp(6482): note: '_Container=add_rvalue_reference<const ContiguousContainer>::type'
    5>C:\Temp\json-develop\src\json.hpp(6482): error C2784: 'const _Elem *std::begin(std::initializer_list<_Elem>) noexcept': could not deduce template argument for 'std::initializer_list<_Elem>' from 'add_rvalue_reference<const ContiguousContainer>::type'
    5>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\initializer_list(60): note: see declaration of 'std::begin'
    6>------ Build started: Project: ALL_BUILD, Configuration: Debug Win32 ------
    6>  Building Custom Rule C:/Temp/json-develop/CMakeLists.txt
    6>  CMake does not need to re-run because C:\Temp\json-develop\build\CMakeFiles\generate.stamp is up-to-date.
    7>------ Skipped Build: Project: INSTALL, Configuration: Debug Win32 ------
    7>Project not selected to build for this solution configuration 
    ========== Build: 3 succeeded, 1 failed, 0 up-to-date, 3 skipped ==========
    
  9. nlohmann commented on Feb 24, 2017

    @nlohmann
    Owner

    @theodelrieu Any idea on this? MSVC seems to have an issue with static_const.

  10. theodelrieu commented on Feb 24, 2017

    @theodelrieu
    Contributor

    I don't know if there is a workaround to that...
    You could send a message to the ranges-v3 maintainers to ask them if they encountered this problem before upgrading to Visual 2015, (the static_const machinery comes from them).

    You could also try to replace const auto& by auto&& at lines 898-899, but I'm 99% certain it won't help.
    Sorry!

  11. nlohmann commented on Feb 28, 2017

    @nlohmann
    Owner

    @pooyan-dadvand Did you try the hack proposed by @theodelrieu?

    You could also try to replace const auto& by auto&& at lines 898-899, but I'm 99% certain it won't help.

  12. pooyan-dadvand commented on Feb 28, 2017

    @pooyan-dadvand

    Not yet... l will do it ASAP!

  13. pooyan-dadvand commented on Mar 1, 2017

    @pooyan-dadvand

    It did not compiled claiming that the expression is not constant. The error:

    3>------ Build started: Project: json_unit, Configuration: Debug Win32 ------
    3>  unit-algorithms.cpp
    3>C:\Temp\json-develop\src\json.hpp(887): error C4579: 'nlohmann::detail::static_const<nlohmann::detail::to_json_fn>::value': in-class initialization for type 'const T' is not yet implemented; static member will remain uninitialized at runtime but use in constant-expressions is supported
    3>          with
    3>          [
    3>              T=nlohmann::detail::to_json_fn
    3>          ]
    3>  C:\Temp\json-develop\src\json.hpp(898): note: see reference to class template instantiation 'nlohmann::detail::static_const<nlohmann::detail::to_json_fn>' being compiled
    3>C:\Temp\json-develop\src\json.hpp(887): error C2131: expression did not evaluate to a constant
    3>  C:\Temp\json-develop\src\json.hpp(887): note: failure was caused by returning the address of or a reference to a temporary
    3>C:\Temp\json-develop\src\json.hpp(887): error C4579: 'nlohmann::detail::static_const<nlohmann::detail::from_json_fn>::value': in-class initialization for type 'const T' is not yet implemented; static member will remain uninitialized at runtime but use in constant-expressions is supported
    3>          with
    3>          [
    3>              T=nlohmann::detail::from_json_fn
    3>          ]
    3>  C:\Temp\json-develop\src\json.hpp(899): note: see reference to class template instantiation 'nlohmann::detail::static_const<nlohmann::detail::from_json_fn>' being compiled
    3>C:\Temp\json-develop\src\json.hpp(6482): error C2784: '_Ty *std::begin(_Ty (&)[_Size]) noexcept': could not deduce template argument for '_Ty (&)[_Size]' from 'add_rvalue_reference<const ContiguousContainer>::type'
    3>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xutility(1250): note: see declaration of 'std::begin'
    3>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits(761): note: see reference to class template instantiation 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>' being compiled
    3>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits(790): note: see reference to class template instantiation 'std::is_nothrow_constructible<_Ty,nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer> &&>' being compiled
    3>          with
    3>          [
    3>              _Ty=nlohmann::json
    3>          ]
    3>  C:\Temp\json-develop\src\json.hpp(12931): note: see reference to class template instantiation 'std::is_nothrow_move_constructible<nlohmann::json>' being compiled
    3>C:\Temp\json-develop\src\json.hpp(6482): error C2893: Failed to specialize function template 'unknown-type std::begin(const _Container &)'
    3>  C:\Temp\json-develop\src\json.hpp(6482): note: With the following template arguments:
    3>  C:\Temp\json-develop\src\json.hpp(6482): note: '_Container=add_rvalue_reference<const ContiguousContainer>::type'
    3>C:\Temp\json-develop\src\json.hpp(6482): error C2893: Failed to specialize function template 'unknown-type std::begin(_Container &)'
    3>  C:\Temp\json-develop\src\json.hpp(6482): note: With the following template arguments:
    3>  C:\Temp\json-develop\src\json.hpp(6482): note: '_Container=add_rvalue_reference<const ContiguousContainer>::type'
    3>C:\Temp\json-develop\src\json.hpp(6482): error C2784: 'const _Elem *std::begin(std::initializer_list<_Elem>) noexcept': could not deduce template argument for 'std::initializer_list<_Elem>' from 'add_rvalue_reference<const ContiguousContainer>::type'
    3>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\initializer_list(60): note: see declaration of 'std::begin'
    4>------ Skipped Build: Project: INSTALL, Configuration: Debug Win32 ------
    4>Project not selected to build for this solution configuration 
    ========== Build: 0 succeeded, 1 failed, 3 up-to-date, 3 skipped ==========
    
    
  14. nlohmann commented on Mar 3, 2017

    @nlohmann
    Owner

    @pooyan-dadvand This is a pity, but I think we cannot help you right now.

  15. 6 remaining items

  16. RiccardoRossi commented on Mar 11, 2017

    @RiccardoRossi
    Author

    Hi Niels,
    we do not have a workaround for this. MSVC2017 works both for your code and for ours, but we can not enforce it as a requirement.
    My hope is that an update4 comes out for msvc2015 fixing the outstanding issues with boost, however there is not much more we can do. For the moment we are using rapidjson internally so not a blocker, just a shame since i liked much more your lib.

    in any case thank you for your time and effort.

  17. ai0376 commented on Oct 16, 2018

    @ai0376

    vs community 2015 run ok!

  18. pooyan-dadvand commented on Oct 16, 2018

    @pooyan-dadvand

    Good news! Thanks for notification!

    @RiccardoRossi we should give it another try then

  19. nlohmann commented on Oct 16, 2018

    @nlohmann
    Owner

    @mjrao I am not using MSVC myself. Is "vs community 2015" something different than "msvc2015"?

  20. gregmarr commented on Oct 16, 2018

    @gregmarr
    Contributor

    Visual Studio Community 2015 is the same as Visual Studio Professional 2015 but with a different license.

  21. nlohmann commented on Oct 18, 2018

    @nlohmann
    Owner

    Thanks for the info. So I can keep the README as is, because there is no additional supported compiler or version.

  22. ai0376 commented on Oct 21, 2018

    @ai0376

    @nlohmann Thanks for your reply! Compile failed in VS 2015 Enterprise and VS 2015 Professional, but compiled successfully in VS 2015 Community. I don't know what happened. Compile error is as follows:
    "nlohmann::detail::static_constnlohmann::detail::to_json_fn::value': in-class initialization for type 'const T' is not yet implemented; static member will remain uninitialized at runtime but use in constant-expressions is supported..."

  23. nlohmann commented on Oct 21, 2018

    @nlohmann
    Owner

    Can you try the develop version and provide the complete error message with line numbers?

  24. gregmarr commented on Oct 22, 2018

    @gregmarr
    Contributor

    @mjrao Are you sure you're using the same update version and compiler settings in both? Sounds like either the community version is a more recent update, or the warning settings are different.

  25. ai0376 commented on Oct 23, 2018

    @ai0376

    VS 2015 Community Vesion: 14.0.25420.01 Update 3 @gregmarr

  26. luomomo commented on Jun 26, 2019

    @luomomo

    Hi ,I meet the problem in vs2015 :C2440,cannot convert from 'initializer-list' to nlohmann::basic_json ,is anyone know how to solve this?

  27. satyamsameer commented on Jun 30, 2020

    @satyamsameer

    Hi Everyone,

    I am trying this library by following all the steps as mentioned by including json.hpp in my project. Here I am also getting the same problem with the following error message.

    error C4579: 'nlohmann::detail::static_constnlohmann::detail::from_json_fn::value': in-class initialization for type 'const T' is not yet implemented; static member will remain uninitialized at runtime but use in constant-expressions is supported

    I am using vs 2015 Pro with Platform Toolset : Visual Studio 2015 (v140).
    Anyone of you found any solution?

    Thanks in advance

  28. ai0376 commented on Jun 30, 2020

    @ai0376

    Hi Everyone,

    I am trying this library by following all the steps as mentioned by including json.hpp in my project. Here I am also getting the same problem with the following error message.

    error C4579: 'nlohmann::detail::static_constnlohmann::detail::from_json_fn::value': in-class initialization for type 'const T' is not yet implemented; static member will remain uninitialized at runtime but use in constant-expressions is supported

    I am using vs 2015 Pro with Platform Toolset : Visual Studio 2015 (v140).
    Anyone of you found any solution?

    Thanks in advance

    use VS 2015 Community. or try vs2019 ?

  29. satyamsameer commented on Jul 1, 2020

    @satyamsameer

    Thanks @mjrao for your reply. Actually in my organization we only have this version of VS subscription it will take time for them to upgrade this but because I need some solution urgently I have now used RapidJSON. I think this is because of old c++ compiler version. Will try this in latest VS as you mentioned I am sure it will work.

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