jsoncpp - 由于类型不完整,无法定义 Json::Reader

jsoncpp - can't define Json::Reader due to incomplete type

本文关键字:定义 Reader Json 于类型 类型 jsoncpp      更新时间:2023-10-16

当我遵循jsoncpp的简单代码示例时出现此错误,基本上是这样的

Json::Reader reader;

如何解决这个问题? 该类型对我来说看起来很完整,但 g++ 不足以告诉我缺少什么或任何东西。

error: aggregate Json::Reader reader has incomplete type and cannot be defined

应该#include <json.h>,而不是我需要的单个类,根据README.txt