警告 325:当前不支持嵌套类(忽略代理)
Warning 325: Nested class not currently supported (Proxy ignored)
我在运行 swig 界面文件时收到以下警告警告 325:当前不支持嵌套类(忽略代理(。我能够抑制警告。但是我需要嵌套类进行计算
下面是接口文件(示例.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.12ExamplesrRinside>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 文件中的嵌套类。如何在接口文件中包含嵌套类?我对摇摆相对较新
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
根据 SWIG 文档...
兼容性说明:在 SWIG-3.0.0 之前,嵌套类支持有限。嵌套类被视为不透明指针。但是,在这些旧版本中有一个嵌套类支持的解决方法,要求用户在全局作用域中复制嵌套类,在全局作用域中为嵌套类添加 typedef,并在嵌套类上使用"嵌套解决方法"功能。这导致了与"平坦嵌套"特征大致相同的行为。由于 SWIG-3.0.0 中现在提供了适当的嵌套类支持,此功能已被弃用,不再需要更改代码。
因此,您应该使用 3.0 或更高版本来支持嵌套类。这将使您避免需要抑制任何内容,并且还可以解决其他问题。
我刚刚遇到了同样的python问题。当我将3.0.12
与嵌套类一起使用时,我只会看到警告:
Warning 325: Nested class not currently supported (Foo ignored)
所以我使用了以下功能:
%module test
%feature("flatnested", "1");
%rename (Bar_Foo) Bar::Foo;
class Foo {};
class Bar {
public:
class Foo {};
};
实际上,在我的问题中,我在需要它的特定情况下再次禁用了该功能(因为它引起了枚举类的麻烦(。
- 嵌套在类中时无法设置成员数据
- 无法访问嵌套类.类的使用无效
- 我正在使用嵌套的while循环来解析具有多行的文本文件,但由于某种原因,它只通过第一行,我不知道为什么
- 如何在C++中初始化嵌套类中的2个memeber
- 如何声明特征矩阵,然后通过嵌套循环初始化它
- 在C++中搜索嵌套多映射值
- 在C++中将矢量转换为嵌套地图
- C++嵌套if语句,基本货币交换
- 在nlohmann json中,如何将嵌套对象的数组转换为嵌套结构的向量
- 嵌套的匿名命名空间
- 了解嵌套循环打印星号图案
- 如何使用boost::具有嵌套结构和最小代码更改的序列化
- 嵌套for循环C++的问题(初学者)
- 从嵌套在std::映射中的std::列表中删除元素的最佳方式
- 用C#中的并集模拟C++嵌套结构
- 部分专业化和嵌套模板
- 嵌套While循环不起作用(C++问题)
- C++-模板嵌套类的引用初始化无效
- 数组嵌套的代理
- 警告 325:当前不支持嵌套类(忽略代理)