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

Compile error. Unable convert form nullptr to nullptr&& #1135

Closed
kirill-782 opened this issue Jun 17, 2018 · 17 comments
Closed

Compile error. Unable convert form nullptr to nullptr&& #1135

kirill-782 opened this issue Jun 17, 2018 · 17 comments
Labels
platform: visual studio related to MSVC solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@kirill-782
Copy link

I can not compile json.hpp.

error C2664: "BasicJsonType *nlohmann::detail::json_sax_dom_parser::handle_value(Value &&)": невозможно преобразовать аргумент 1 из "nullptr" в "nullptr &&"

problem code:

    bool null() override
    {
        handle_value(nullptr); 
        return true;
    }
@nlohmann nlohmann added platform: visual studio related to MSVC state: needs more info the author of the issue needs to provide more details labels Jun 17, 2018
@nlohmann
Copy link
Owner

What code do you try to compile? Which compiler are you using? What version of the library are you using?

@kirill-782
Copy link
Author

visual studio 2015 (vc140). library downloaded from develop branch (last version)

#include <nlohmann/json.hpp> // single include

using namespace std;

using json = nlohmann::json;

int main( void )
{
	json j = "{ \"happy\": true, \"pi\": 3.141 }"_json;
	return 0;
}

@nlohmann
Copy link
Owner

Is that compiler supported? From the README: Microsoft Visual C++ 2015 / Build Tools 14.0.25123.0 (and possibly later)

@kirill-782
Copy link
Author

Microsoft Visual Studio Enterprise 2015
Версия 14.0.25431.01 Update 3
Microsoft .NET Framework
Версия 4.7.03056

@nlohmann
Copy link
Owner

Could you try to remove using namespace std?

@nlohmann nlohmann added state: help needed the issue needs help to proceed and removed state: needs more info the author of the issue needs to provide more details labels Jun 17, 2018
@kirill-782
Copy link
Author

Nothing has changed

@nlohmann
Copy link
Owner

That is strange as we use MSVC 2015 with AppVeyor in your CI suite.

@kirill-782
Copy link
Author

Can any macro be defined? Or any compilation option? Can you sln the file?

@nlohmann
Copy link
Owner

Maybe related: #987.

@nlohmann
Copy link
Owner

Can any macro be defined? Or any compilation option? Can you sln the file?

What do you mean by that?

@nlohmann
Copy link
Owner

@kirill-782 Could you comment on #1135 (comment) ?

@kirill-782
Copy link
Author

I'm interested in Build Tools. 140 or 141?

@nlohmann
Copy link
Owner

AppVeyor uses Microsoft (R) Build Engine version 14.0.25420.1, MSVC 19.0.24215.1. What do you mean?

@kirill-782
Copy link
Author

It is very strange.

@nlohmann
Copy link
Owner

nlohmann commented Jul 9, 2018

I don't know how to proceed here. To summarize, it seems as if you are using the exact compiler version as we are doing on AppVeyor. Could you make sure that you run the exact same commands as here?

@kirill-782
Copy link
Author

The problem was solved by disabling the CRL in the compiler settings

@nlohmann
Copy link
Owner

Thanks for checking back!

@nlohmann nlohmann added solution: proposed fix a fix for the issue has been proposed and waits for confirmation and removed state: help needed the issue needs help to proceed labels Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: visual studio related to MSVC solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants