rapidjson + c++: "abort() has been called" 错误

rapidjson + c++: "abort() has been called" error

我需要在我的 C++ 程序中解析 json。为此,我决定使用 RapidJson 库,但出现 "abort() has been called" 错误。我将代码截断为:

#include <iostream>
#include <cstdlib>
#include "rapidjson/document.h"
#include "rapidjson/writer.h"
#include "rapidjson/encodings.h"
#include "rapidjson/stringbuffer.h"

using namespace std;
using namespace rapidjson;

typedef GenericDocument<UTF16<> > WDocument;
typedef GenericValue<UTF16<> > WValue;

wchar_t request[] = L"{\"result\":\"OK\"}";

int main()
{
    WDocument d;
    d.Parse(request);
    WValue& v = d[L"result"]; // The exception throws here
    if (wcscmp(v.GetString(), L"OK"))
    {
        cout << "Success!" << endl;
    }
    else
        cout << "Fail!" << endl;
    system("pause");
    return 0;
}

但是我又报错了。错误在哪里?提前致谢!

检查这一行:
wchar_t request[] = L"{\"result\":\"OK\"}";

左大括号前有一个字符。