2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[openFrameworks] ofxJsonUtils(ofJson)+Xcode10.2でハマった時に

2
Last updated at Posted at 2019-04-05

ハマりました.

結論

俺は悪くない.

解決策

これ結局 nlohmann jsonと最近のC++の噛み合わせの問題なのでoF0.10.0/1の ofJson でも起きます.

oF0.9.xの人

最新のofxJsonUtilsのmaster使って.

oF0.10.x〜の人

oF本体のjson.hpp を nlohmann/json 3.6.1 に置き換えましょう.

apothecaryレポでは既に先週くらいにbakercp先生が openframeworks/apothecary/pull#130 を出してマージされてたのでoF0.10.2 からは気にしなくて良くなると良いですね.

以下トラブルシュートの様子

問題点

Apple LLVM clangのバージョンが上がったせいか

ofJson json;
std::string str;
str = json["hoge"];

とするとコンパイルが通らない.
(std::string_view が怪しそうだけど結局原因ははっきり分かってない.)

ハマった点

ofJson json;
std::string str = json["hoge"];

だと問題が起きないせいで自分のofxJsonUtilsが悪いと思ってしまった.

nlohmann/json/issues#1362 は読んだんだから気付いていれば睡眠時間削らずに済んだのに...

反省点

issueはちゃんと読みましょう.

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?