小编jac*_*son的帖子

为什么我不能将swig包装std :: vector转换为Ruby类?

我有一个带有嵌入式Ruby解释器的应用程序,以及与swig生成的STL类的接口.除了一件事,几乎一切都很好,这要归功于swig:

%module Stuff
%import "std_vector.i"
namespace std
{
  %template(Vectord) vector<double>;
}; 

%inline%{
  std::vector<double> test;
%}
Run Code Online (Sandbox Code Playgroud)

当我尝试在Ruby中使用它时,类型Stuff::Vectord存在,但它不是生成的单例方法测试的返回类型.查看生成的C包装器文件,我可以看到类Vectord和它的方法被定义,但看着_wrap_test_get我没有看到返回sth类的任何东西Stuff::Vectord.

我需要做什么来test打字Vectord

ruby swig stl

28
推荐指数
1
解决办法
1489
查看次数

标签 统计

ruby ×1

stl ×1

swig ×1