基于本教程 - http://www.r-bloggers.com/using-r-callling-c-code-with-rcpp/ 我试图从 R 调用 C 函数。C 代码具有以下依赖项,它编译C代码后完美运行
#include <json/json.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curl/curl.h>
#include <time.h>
#include <math.h>
#include <Rcpp.h>
现在,当我尝试加载 so 文件时,我看到以下错误。
dyn.load("storage.so")
Error in dyn.load("storage.so") :
unable to load shared object '/home/algotree/Rcode/storage.so':
/home/algotree/Rcode/storage.so: undefined symbol: json_object_array_length
似乎 R 无法链接其余的头文件。
我该如何解决?