如何在C ++程序中添加RapidJSON头文件

问题描述

实际上,我在项目中添加了Rapidjson文件。但是在编译该程序时,它显示一个错误

错误消息

[错误] Rapidjson.h:没有这样的文件或目录

编译终止。

目标“ main_1.o”的D:\ Ramya \ Makefile.win配方失败

这里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;
    
}




    

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)