SymbolixAU/jsonify

Example Rcpp does not work

JosiahParry opened this issue · 1 comments

The example at https://symbolixau.github.io/jsonify/index.html#what-do-you-mean-by-available-at-the-source does not work.
DESCRIPTION file contains

LinkingTo: 
    Rcpp,
    jsonify

And in src/jsonify-testing.cpp contains

// [[Rcpp::depends(jsonify)]]
#include "jsonify/jsonify.hpp"

Rcpp::StringVector my_json( Rcpp::DataFrame df ) {
  return jsonify::api::to_json( df );
}

Sourcing the file or documenting the package results in the error

/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/jsonify/include/jsonify/jsonify.hpp:5:10: fatal error: 'rapidjson/document.h' file not found
   #include "rapidjson/document.h"

Thanks - I've updated the docs, but to get it work you also need to include rapidjsonr in the LinkingTo:

LinkingTo:
  Rcpp,
  rapidjsonr (>= 1.2.0),
  jsonify