Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVC 2015 update 2 #469

Closed
RiccardoRossi opened this issue Feb 23, 2017 · 34 comments
Closed

MSVC 2015 update 2 #469

RiccardoRossi opened this issue Feb 23, 2017 · 34 comments
Labels

Comments

@RiccardoRossi
Copy link

RiccardoRossi commented Feb 23, 2017

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

@nlohmann nlohmann added the platform: visual studio related to MSVC label Feb 23, 2017
@nlohmann
Copy link
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?

@RiccardoRossi
Copy link
Author

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

@pooyan-dadvand
Copy link

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)'

@nlohmann
Copy link
Owner

Thanks. Could you compile the unit tests?

@pooyan-dadvand
Copy link

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

@nlohmann
Copy link
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?

@pooyan-dadvand
Copy link

pooyan-dadvand commented Feb 24, 2017

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

@pooyan-dadvand
Copy link

pooyan-dadvand commented Feb 24, 2017

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 ==========

@nlohmann
Copy link
Owner

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

@theodelrieu
Copy link
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!

@nlohmann
Copy link
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.

@pooyan-dadvand
Copy link

Not yet... l will do it ASAP!

@pooyan-dadvand
Copy link

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 ==========

@nlohmann
Copy link
Owner

nlohmann commented Mar 3, 2017

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

@RiccardoRossi
Copy link
Author

Hi Niels, shame to hear this.
Just one more question before i give up: wouldn't it be possible to make a copy instead of passing a const reference? guess it would be slower, but if that works i would pay that price to preserve backward compatibility.
(please be patient if the suggestion is stupid)

@theodelrieu
Copy link
Contributor

@RiccardoRossi are you talking about the static_const?

@RiccardoRossi
Copy link
Author

RiccardoRossi commented Mar 5, 2017 via email

@theodelrieu
Copy link
Contributor

Well, it's not gonna help, if I remember correctly, the point of being a reference in an anonymous namespace is to prevent ODR-violation.

You can read this Eric Niebler's blog post to know the very details (I don't remember all of them)

I hope the next MSVC release will solve your Boost.Python problems

@pooyan-dadvand
Copy link

Hope so!

Time will solve everything, even MSVC problems!

Thanks.

@nlohmann
Copy link
Owner

I close this issue here as there is nothing we can do. @RiccardoRossi @pooyan-dadvand it would be great if you could give us feedback whether this issue eventually was resolved.

@RiccardoRossi
Copy link
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.

@ai0376
Copy link

ai0376 commented Oct 16, 2018

vs community 2015 run ok!

@pooyan-dadvand
Copy link

Good news! Thanks for notification!

@RiccardoRossi we should give it another try then

@nlohmann
Copy link
Owner

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

@gregmarr
Copy link
Contributor

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

@nlohmann
Copy link
Owner

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

@ai0376
Copy link

ai0376 commented Oct 21, 2018

@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..."

@nlohmann
Copy link
Owner

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

@gregmarr
Copy link
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.

@ai0376
Copy link

ai0376 commented Oct 23, 2018

VS 2015 Community Vesion: 14.0.25420.01 Update 3 @gregmarr

@luomomo
Copy link

luomomo commented Jun 26, 2019

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

@satyamsameer
Copy link

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

@ai0376
Copy link

ai0376 commented Jun 30, 2020

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 ?

@satyamsameer
Copy link

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
Labels
Projects
None yet
Development

No branches or pull requests

8 participants