swig

    0热度

    1回答

    我有这种结构在C: typedef struct THTensor { ... ptrdiff_t storageOffset; ... } THTensor; 然而,SWIG生成的Java代码为: public SWIGTYPE_p_ptrdiff_t getStorageOffset() { return new SWIGTYPE_p_ptrdif

    -1热度

    1回答

    我试图在CentOS 7 My environment: gcc (g++) 7.20, bazel 0.5.3, python3 (with all necessary dependencies listed on tensorflow web site), swig 3.0.12, openjdk 8. Everything is installed in the users scope, w

    0热度

    1回答

    我想生成下面的C函数R(编程语言)包装: int *test(void) { int i; i = 1024; return (int *) i; } 为了创建这个包装,我使用痛饮具有以下接口: %module X %{ extern int *test(void); %} extern int *test(void); 我可以成功创建

    1热度

    1回答

    每当我通过终端运行以下代码时都会产生错误。 这里是我的代码: number.h: class Number{ public: Number(int start); void add(int x); void sub(int x); void display(); int data; }; number.cxx: #include <iost

    1热度

    4回答

    我有一个函数形式 void f(unsigned char *out, const unsigned long long outlen, const unsigned char *in, const unsigned long long inlen); ,当我尝试使用它: data_in = ['a', 'b', 'c', 'd', 'e'] data_out = [0]*100

    0热度

    1回答

    Swig文档说array_class()不应与char或char *一起使用。 http://www.swig.org/Doc3.0/Library.html#Library_carrays 注:%array_functions()和%array_class()不应该与 类型char或字符*一起使用。 目前尚不清楚为什么。有人能解释原因吗? 这是为了避免与字符串碰撞?可以用unsigned cha

    1热度

    1回答

    我使用痛饮生成我的C库,例如: mylib.py和_mylib.pyd int func(uint8_t* a) { return *a; } 在python: import mylib import ctypes a = (ctypes.c_uint8 * 8)() mylib.func(a) 但在运行的Python给我一个错误:TypeError: in metho

    2热度

    1回答

    我不明白为什么值会从func1丢到func2然后是main。它可以在func1中打印,但在func2和main中失败。 我不认为这是一个swig问题,更像是一个C++代码问题〜你可以用下面的代码重现问题。 我TEST.CPP: #include <string> #include <iostream> #include <vector> #include <algorithm> #incl

    1热度

    1回答

    我使用痛饮,并在头文件evidence.h,我有以下几点: namespace dai { class Evidence { public: typedef std::map<Var, size_t> Observation; }; } 而且在痛饮接口文件dai.i,我有以下几点: //The types are defined in both

    2热度

    1回答

    我试图运行痛饮对供应商的头,所以我并不需要重新实施在一个单独的头文件 swig -go -cgo -intgosize 64 -module qt -o $WORK/qt/_obj/qt_wrap.cxx -outdir $WORK/qt/_obj/ \ -I$HOME/Qt5.9.1/5.9.1/gcc_64/include -I$HOME/Qt5.9.1/5.9.1/gcc_64/inclu