Skip to content

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

Closed

Description

@kirill-782

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;
    }

Activity

  1. nlohmann commented on Jun 17, 2018

    @nlohmann
    Owner

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

  2. kirill-782 commented on Jun 17, 2018

    @kirill-782
    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;
    }
    
  3. nlohmann commented on Jun 17, 2018

    @nlohmann
    Owner

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

  4. kirill-782 commented on Jun 17, 2018

    @kirill-782
    Author

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

  5. nlohmann commented on Jun 17, 2018

    @nlohmann
    Owner

    Could you try to remove using namespace std?

  6. added and removed
    state: needs more infothe author of the issue needs to provide more details
    on Jun 17, 2018
  7. kirill-782 commented on Jun 17, 2018

    @kirill-782
    Author

    Nothing has changed

  8. nlohmann commented on Jun 18, 2018

    @nlohmann
    Owner

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

  9. kirill-782 commented on Jun 20, 2018

    @kirill-782
    Author

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

  10. nlohmann commented on Jun 20, 2018

    @nlohmann
    Owner

    Maybe related: #987.

  11. nlohmann commented on Jun 20, 2018

    @nlohmann
    Owner

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

    What do you mean by that?

  12. nlohmann commented on Jun 26, 2018

    @nlohmann
    Owner

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

  13. kirill-782 commented on Jun 26, 2018

    @kirill-782
    Author

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

  14. nlohmann commented on Jun 26, 2018

    @nlohmann
    Owner

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

  15. kirill-782 commented on Jun 27, 2018

    @kirill-782
    Author

    It is very strange.

  16. nlohmann commented on Jul 9, 2018

    @nlohmann
    Owner

    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?

  17. kirill-782 commented on Jul 10, 2018

    @kirill-782
    Author

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

  18. nlohmann commented on Jul 10, 2018

    @nlohmann
    Owner

    Thanks for checking back!

  19. added
    solution: proposed fixa fix for the issue has been proposed and waits for confirmation
    and removed on Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions