Mocolicious
Mocolicious

Reputation: 325

Jsoncpp Json:Reader causing error " Debug assertion... _pFirstBlock == pHead"

I am trying to make a program that will use Json from a website and I seem to be having a problem with this:

std::ifstream ifile("json.txt");
Json::Reader reader;
Json::Value root;
if (ifile != NULL && reader.parse(ifile, root)) {
    const Json::Value arrayDest = root["dest"];
    for (unsigned int i = 0; i < arrayDest.size(); i++) {
        if (!arrayDest[i].isMember("name"))
        continue;
        std::string out;
        out = arrayDest[i]["name"].asString();
        std::cout << out << "\n";
    }
}

I have narrow down the issue to the line Json::Reader reader;

and it giving me an error:

Debug assertion... _pFirstBlock == pHead

I'm using jsoncpp

Upvotes: 1

Views: 1004

Answers (1)

Josh Kelley
Josh Kelley

Reputation: 58342

This is not a JsonCpp error; pHead appears nowhere in the JsonCpp source code. From a brief Google search, it looks like an error reported within Microsoft Visual C++'s runtime libraries, triggered by a mismatch between where memory is allocated and where it's freed when DLLs are in use, or between which versions of the C runtime are being used, or between how the C runtime is being linked.

Upvotes: 1

Related Questions