swig

    3熱度

    1回答

    我使用SWIG來翹曲一個非常簡單的C++類。 boost ptime用於該C++類。 當我嘗試執行命令 swig -c++ -python example.i 有一個錯誤: example.h:7: Warning 315: Nothing known about 'boost::posix_time::ptime'. example.h:7: Warning 315: Nothing kn

    13熱度

    2回答

    http://www.swig.org/papers/PyTutorial98/PyTutorial98.pdf 它來自上面的鏈接: 我知道這是一個古老的發佈中,因此它是可能的信息是過時的。 我想問: 「似乎做工精細用C++,如果你不是太聰明」 是什麼意思,是太聰明嗎? 是否有已知的情況/案例,我非常小心,我在編程C++模塊並使用swig工具擴展Python?

    1熱度

    1回答

    我開始swig和php工作,我想返回std::vector<std::string>我php code.I有試試這個(所有的編譯工作)。 我痛飲文件: %module example %include <std_string.i> %include <std_vector.i> %{ extern std::vector<std::string> testSwig(const c

    3熱度

    2回答

    考慮以下最小例如:我有一個C++函數「myfun」採用一個號碼和另一個函數作爲輸入,並返回x處評估的功能: double myfun(double x, double (*f)(double y)) { return f(x); } 我將此代碼存儲在'test.cpp'中。在相應的頭文件「test.hpp」的代碼只是 double myfun(double x, double (*f)(doubl

    1熱度

    1回答

    : %module abc %{ extern int my_function(int number); %} extern int my_function(int number); 它會生成以下公共靜態Java包裝方法: public static int my_function(int number) { return abcJNI.my_function(n

    1熱度

    1回答

    例如,有C++編寫的類繼承LUA: //Say.h #pragma once #include <iostream> class Say { public: Say() {} virtual ~Say() {} virtual void SaySomething() { std::cout << "It should not be show..\n";

    1熱度

    2回答

    我有一個C++實現,用SWIG包裝並編譯爲一個可以被python使用的模塊。 我正在使用ctypes來調用帶有ctype參數的函數,int double等。 my_function(ctype args)的輸出是一個int **,即它是一個多維數組。 我怎樣才能把這個變成一個2D numpy數組在Python腳本內?我一直在看ctypes指針,但到目前爲止我沒有運氣。我已經花了很多很多時間閱讀Py

    1熱度

    1回答

    我試圖按照痛飲教程,但我卡住了,現在我使用: 的Python 3.5.1(V3.5.1:37a07cee5969,2015年12月6日, 1點54分25秒)[MSC v.1900 64位(AMD64)]在Win32 Vs2015 64,微軟(R)C/C++優化編譯器版19.00.23918針對x64 SWIG版3.0.10 內容爲: example.c #include <time.h> dou

    4熱度

    2回答

    鑑於下面生成文件: TARGET = _example.pyd OFILES = example.obj example_wrap.obj HFILES = CC = cl CXX = cl LINK = link CPPFLAGS = -DNDEBUG -DUNICODE -DWIN32 -I. -Id:\virtual_envs\py351\include CFLAGS = -

    1熱度

    1回答

    我學習痛飲,我想了解,我一直沒能找的文檔&例子後找出一些C++可能出現的情況,這是我的內容: usecase1.h #ifndef __USECASE1_H__ #define __USECASE1_H__ namespace foo_namespace { int usecase1_f1(float b, float c, float *res); } #endif u