Skip to content

Cannot assign string to a json value #871

Closed
@pps83

Description

@pps83

That's kind of crazy the problem exists in the library, but the most obvious thing doesn't seem to work:

    Json::Value jmessage;
    std::string sdp;
    jmessage["something"] = sdp;

this results in a link error:

error LNK2019: unresolved external symbol "public: class Json::Value & __thiscall Json::Value::operator=(class Json::Value const &)"

I get this error with when using # define JSONCPP_VERSION_STRING "1.6.5"

If I take current git it doesn't even compile:

2>json/json.h(298): error C2065: 'SecureAllocator': undeclared identifier

In general, those implicit constructors that construct string to Json::Value aren't a good idea IMO. Library should also provide .assign methods. In both case I use amalgamated version

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions