报错:json/json.h: No such file or directory

2025年9月24日 | 分类: 【技术】

参考:https://blog.csdn.net/qq_41821678/article/details/120331269

报错:

ASTNodes.h:6:23: fatal error: json/json.h: No such file or directory
#include

首先检查一下有没有这个文件;如果有,则应该是文件路径不对,通过链接建立关系;如果没有,则下载该相关文件。

sudo apt-get install libjsoncpp-dev
sudo ln -s /usr/include/jsoncpp/json/ /usr/include/json

#include 代表/usr/include/json/json.h。include就是/usr/include/文件夹