【发布时间】:2017-08-11 02:19:44
【问题描述】:
我在运行 swig 接口文件时收到以下警告 警告 325:当前不支持嵌套类(忽略代理)。 我能够取消警告。但我需要嵌套类进行计算
下面是接口文件(example.i)
%module example
%{
#include "Rinside.h"
#include "Rinsidecommon.h"
#include "Callbacks.h"
%}
/* Let's just grab the original header file here */
%include "Rinside.h"
%include "Rinsidecommon.h"
%include "Callbacks.h"
在执行接口文件时。以下是警告
C:\swigwin-3.0.12\Examples\r\Rinside>swig -tcl -c++ example.i
Rinside.h(70) : Warning 325: Nested class not currently supported (Proxy ignored)
Rinside.h(91) : Warning 503: Can't wrap 'operator []' unless renamed to a valid identifier.
我正在尝试从 Tcl 调用 RInside。首先,我的 C 代码应该能够接受参数,通过传递这些参数调用 RInside,并打印 RInside 执行的结果。
下面是我在 Rinside.h 文件中的嵌套类。 如何在接口文件中包含嵌套类? 我对 swig 比较陌生
class Proxy {
public:
Proxy(SEXP xx): x(xx) { };
template <typename T>
operator T() {
return ::Rcpp::as<T>(x);
}
private:
Rcpp::RObject x;
};
谁能给我一个骨架或部分代码。对我有帮助
包装 cpp 代码时出现以下错误
rinside_sample0_wrap.cxx: In function 'int _wrap_RInside_parseEval__SWIG_1(ClientData, Tcl_Interp*, int, Tcl_Obj* const*)':\
rinside_sample0_wrap.cxx:1906:18: error: no matching function for call to 'RInside::Proxy::Proxy()'
In file included from rinside_sample0_wrap.cxx:1700:0:
Rinside.h:61:6: note: candidate: RInside::Proxy::Proxy(SEXP)
Proxy(SEXP xx): x(xx) { };
Rinside.h:61:6: note: candidate expects 1 argument, 0 provided
【问题讨论】:
-
向我们展示一个重现问题的最小完整示例界面。
-
已编辑请帮忙