dropbox / json11

A tiny JSON library for C++11.
MIT License
2.55k stars 616 forks source link

can't be loaded as a dll in low version c++? #140

Closed kematy closed 5 years ago

kematy commented 5 years ago

it seems can't be loaded as a dll in low version c++.I have compiled it into json11.so and libjson11.a,I want to use the lib in the low version c++ with mingw32 ,I tried to parse a json file in an instance method,but get some errors:

qinwriter.cpp: In member function 'void QinWriter::json11_test()': qinwriter.cpp:82:28: error: 'class std::__cxx11::basic_string' has no member named 'array_items' for (auto &k : features.array_items()) { ^~~ qinwriter.cpp:83:71: error: expected ')' before ';' token acdbentity=(k.dump()["properties"]["SubClasses"].string_value(); ^ qinwriter.cpp:95:11: error: expected ':' before '{' token { auto pt=(k.dump()["properties"]["geometry"]["coordinates"]; ^ qinwriter.cpp:95:73: error: expected ')' before ';' token { auto pt=(k.dump()["properties"]["geometry"]["coordinates"]; ^ qinwriter.cpp:96:67: error: expected ')' before ';' token auto r=(k.dump()["properties"]["geometry"]["radius"]; ^ qinwriter.cpp:101:11: error: expected ':' before '{' token { auto pt1=(k.dump()["properties"]["geometry"]["coordinates"][0]; ^ qinwriter.cpp:101:77: error: expected ')' before ';' token { auto pt1=(k.dump()["properties"]["geometry"]["coordinates"][0]; ^ qinwriter.cpp:102:77: error: expected ')' before ';' token auto pt2=(k.dump()["properties"]["geometry"]["coordinates"][1];

kematy commented 5 years ago

the main error is : qinwriter.cpp: In member function 'void QinWriter::json11_test()': qinwriter.cpp:82:28: error: 'class std::__cxx11::basic_string' has no member named 'array_items' for (auto &k : features.array_items()) { ^~~ others are synax errors...

j4cbo commented 5 years ago

json11 requires a modern C++11 compiler; it won't work with an old compiler.