c++ - 如何在c++程序中添加rapidjson头文件
问题描述
实际上我在我的项目中添加了 rapidjson 文件。但是在编译这个程序时,它向我显示了一个错误。
错误信息
[错误] rapidjson.h:没有这样的文件或目录
编译终止。
D:\Ramya\Makefile.win 目标“main_1.o”的配方失败
这里 main_1 是我的文件名。
请任何人帮助我。谢谢 !
#include <iostream>
#include <stdlib.h>
#include "rapidjson.h"
#include "document.h"
using namespace std;
using namespace rapidjson;
Document document;
void parse_file(void)
{
/* Open the example.json file in read mode */
FILE* fp = fopen("example.json", "r");
/* Declare read buffer */
char readBuffer[65536];
/* Declare stream for reading the example stream */
FileReadStream is(fp, readBuffer, sizeof(readBuffer));
/* Parse example.json and store it in `document` */
document.ParseStream(is);
/* Close the example.json file*/
fclose(fp);
}
int main()
{
char name[50];
int t_value;
parse_file();
return 0;
}
解决方案
推荐阅读
- string - 使用 powershell 在两个部分之间更新文本文件
- sql - 如何获取数组中的所有元素,而不是 HIVE 中的另一个数组中的所有元素?
- jquery - jquery 返回未定义的读取 json
- c# - 为 json 字符串创建 c# 类,其中有数字作为对象中的变量
- java - 什么是 MavenProject.managedVersionMap
- c++ - “无运算符”运算符,它是什么?
- javascript - 在返回未定义的二叉树函数中查找最近的节点
- spring - java.lang.IllegalStateException:Bean 名称“greeting”的 BindingResult 和普通目标对象都不能用作请求属性
- php - 如何手动(无形式)验证用户?Cakephp 4x
- excel - Excel Vlookup 或公式