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

Illegal indirection #467

Closed
brunohkbx opened this issue Feb 22, 2017 · 7 comments
Closed

Illegal indirection #467

brunohkbx opened this issue Feb 22, 2017 · 7 comments
Labels

Comments

@brunohkbx
Copy link

I'm trying to use it in VS2015 but when I try to compile I got this error.

C2100 Illegal indirection

@nlohmann nlohmann added the platform: visual studio related to MSVC label Feb 22, 2017
@nlohmann
Copy link
Owner

This is strange, because the project compiles with AppVeyor without problems:

What is the exact error message? What compilation flags are you using?

@brunohkbx
Copy link
Author

I just updated my VS2015 and its working fine.
Thanks!

@glennra
Copy link

glennra commented Mar 24, 2017

I have this issue too. Using 2.1.1.

Microsoft Visual Studio Community 2015
Version 14.0.24720.00 Update 1

All I have done is added #include "json.hpp" to my source file.

c:\path\to\json.hpp(887): error C2100: illegal indirection
c:\path\to\json.hpp(898): note: see reference to class template instantiation 'nlohmann::detail::static_constnlohmann::detail::to_json_fn' being compiled

Compilation flags generated by CMake:
/Yu"StdAfx.h" /GS /TP /W3 /Zc:wchar_t /I"C:\Boost\include\boost-1_60" /Zi /Gm- /Od /Ob0 /Fd"MyLib.dir\Debug\MyLib.pdb" /Zc:inline /fp:precise /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "BOOST_LOG_DYN_LINK" /D "BOOST_USE_WINAPI_VERSION=0x0601" /D "CMAKE_INTDIR="Debug"" /D "_MBCS" /errorReport:prompt /WX- /Zc:forScope /RTC1 /GR /Gd /MDd /Fa"Debug/" /EHsc /nologo /Fo"MyLib.dir\Debug" /Fp"MyLib.dir\Debug\MyLib.pch"

@nlohmann
Copy link
Owner

@glennra The tests at AppVeyor work with MSVC 14.0.25420.1 (see https://ci.appveyor.com/project/nlohmann/json for detailed output). I'm not sure about the differences to the version you are using, but @brunohkbx seems to have fixed the issue by updating.

@glennra
Copy link

glennra commented Mar 26, 2017

Thanks. It works with:
Microsoft Visual Studio Community 2015
Version 14.0.25431.01 Update 3

VS usually automatically offers updates but in this case it had not done that so I had to manually download and run the updater.

@Hafnernuss
Copy link

I can confirm this, by updating from Update 1 to Update 3 everything works fine.

@nlohmann
Copy link
Owner

Thanks for reporting!

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

4 participants