gpt4 book ai didi

c++ - Jsoncpp JSON :Reader causing error "Debug assertion... _pFirstBlock == pHead"

转载 作者:太空宇宙 更新时间:2023-11-04 11:32:23 26 4
gpt4 key购买 nike

我正在尝试制作一个将使用来自网站的 Json 的程序,但我似乎遇到了这个问题:

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

我已将问题缩小到这一行 Json::Reader 阅读器;

它给我一个错误:

Debug assertion... _pFirstBlock == pHead

我正在使用 jsoncpp

最佳答案

这不是 JsonCpp 错误; pHead 在 JsonCpp 源代码中没有出现。通过简短的谷歌搜索,它看起来像一个 error reported within Microsoft Visual C++'s runtime libraries。 ,由使用 DLL 时分配内存的位置和释放内存的位置之间的不匹配触发,或者在使用的 C 运行时版本之间,或者 C 运行时的链接方式之间不匹配。

关于c++ - Jsoncpp JSON :Reader causing error "Debug assertion... _pFirstBlock == pHead",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24233908/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com