#include “nlohmann/json.hpp” // 需要安装 nlohmann/json.hpp 头文件
using json = nlohmann::json;
下载链接:https://github.com/nlohmann/json/tree/develop
1.下载并解压:首先,需要从nlohmann/json的GitHub仓库下载源代码,并解压得到的文件。 地址:
nlohmann/json: JSON for Modern C++ (github.com)
https://github.com/nlohmann/json/tree/develop
2.拷贝头文件:解压后,会得到一个名为include的文件夹,将该文件夹下的所有文件拷贝到的工程文件夹下。
3.修改工程属性:在Visual Studio中,打开项目属性,找到“C/C++”选项下的“附加包含目录”,将刚才拷贝的include文件夹的路径添加进去。
1,手动编译与自动编译
手动编译示例

当用vs编译器时,不需要手动编译,在 Visual Studio(VS) 中,不需要手动执行 cl /I include main.cpp /Fe:my_program.exe,可以直接在 VS 项目 中 配置包含目录,然后正常编译。
直接点击 “生成(Build)” 或 按 F5 运行,不需要手动执行 cl 命令。
订阅专栏 解锁全文
4458

被折叠的 条评论
为什么被折叠?



