byzhang / rapidjson

Automatically exported from code.google.com/p/rapidjson
MIT License
0 stars 0 forks source link

Cant compile document.h #89

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Exact Error Message:
Error   3   error C2059: syntax error : 'this'  include\rapidjson\document.h    213

Line 213:
GenericValue& SetNull() { this->~GenericValue(); new (this) GenericValue(); 
return *this; }

Code i Used for testing:
const char json[] = "{ \"hello\" : \"world\" }";
rapidjson::Document d;
d.Parse<0>(json);

Version of rapidjson:
rapidjson 1.1

System:
- Windows Server 2008 R2
- VS2010

I would like to parse a json string into a c++ object.

Thanks in advance,

Michael

Original issue reported on code.google.com by schuetz....@gmail.com on 14 Aug 2013 at 4:56

GoogleCodeExporter commented 9 years ago
The same error :(
Maybe some project options are needed.

Original comment by dirondin on 4 Sep 2013 at 2:42

GoogleCodeExporter commented 9 years ago
I worked around this in the following manner.

#pragma push_macro("new")
#undef new
#include "rapidjson\document.h"
#include "rapidjson\writer.h"
#pragma pop_macro("new") 

The issue was the system I was building in had a "new" macro

Original comment by doug.rei...@gmail.com on 10 Jan 2014 at 4:36

GoogleCodeExporter commented 9 years ago
Cannot reproduce this.
Do the unit tests and examples (e.g. tutorial) work?
Please checkout the latest copy at https://github.com/miloyip/rapidjson
If problem persist, please create an issue at github. Thank you.

Original comment by milo...@gmail.com on 30 Jun 2014 at 4:51