<div dir="ltr"><span class="gmail-im" style=""><div style="">(Resending to list, sorry)<font color="#500050"> </font><br></div><div style=""><font color="#500050"><br></font></div><blockquote class="gmail_quote" style="color:rgb(80,0,80);margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">| I was pleasantly surprised how easy it was to make a header-only package<br>| (by cannabalizing BH and copying the hpp file to inst/include).<br><br>Why?  Is LinkingTo: BH not good enough?<br></blockquote><div style="color:rgb(80,0,80)"><br></div></span><div>I'm not using Boost for json, instead using this <a href="https://nlohmann.github.io/json/" target="_blank">https://nlohmann.github.io/json/</a> for the</div><div>syntax sugar.</div><div><br></div><div>But I wanted to start with something that was working instead of starting from scratch, in case</div><div>there were package configuration that had to be set to make // [[Rcpp::depends(RcppJson)]]</div><div>compile correctly. But Rcpp::depends seems to find everything automatically, it "just works".</div><span class="gmail-im" style="color:rgb(80,0,80)"><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">| Maybe someone else will find this useful some day.<br><br>There are also R (at least) cpp-using package ndjson and validatejsonr on CRAN.<br></blockquote><div><br></div></span><div>Those are good finds. Not sure if you can use them from inside C++ though.</div><div><br></div><div>It looks like Bob Rudis is also using the nlohmann/json.h, maybe I can ask him to</div><div>move json.h from src/ to inst/include for his next release. I think that's all that needed</div><div>to make Rcpp::depends / LinkingTo work.</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 11, 2018 at 12:18 PM Dirk Eddelbuettel <<a href="mailto:edd@debian.org">edd@debian.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On 11 October 2018 at 11:50, Neal Fultz wrote:<br>
| I recently needed to deal with json on the C++ side of things, and found<br>
| the nlohmann json library.<br>
| <br>
| I made a small wrapper package: <a href="https://github.com/nfultz/RcppJson" rel="noreferrer" target="_blank">https://github.com/nfultz/RcppJson</a><br>
<br>
Cool.<br>
<br>
| I was pleasantly surprised how easy it was to make a header-only package<br>
| (by cannabalizing BH and copying the hpp file to inst/include).<br>
<br>
Why?  Is LinkingTo: BH not good enough?<br>
| <br>
| Maybe someone else will find this useful some day.<br>
<br>
There are also R (at least) cpp-using package ndjson and validatejsonr on CRAN.<br>
<br>
Dirk<br>
<br>
-- <br>
<a href="http://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a><br>
</blockquote></div>