0
I own a .dll
that within it has a function BOLHA
that returns a double
.
The problem is that BOLHA
has a vector<double>
in the argument.
extern "C" minhaDLL_API double BOLHA(vector<double> OI);
In fact she possesses a extern "C"
which makes me believe that at the time of compiling the .dll
This became a pointer to double
. I tried to load this function from .dll
in Python as follows:
mydll = cdll.LoadLibrary("_DLL.dll")
func = mydll.BOLHA
func.argtypes = [POINTER(c_double)]
func.restype = c_double
returnarray = (c_double * 2)(0.047948, 0.005994)
func(returnarray)
But it returns me the error:
[Error -529697949] Windows Error 0xE06D7363
You cannot have C++ names exported as C names, as far as I know. And
std::vector<double>
is not a pointer, definitely. This code smells like undefined behavior.– Mário Feroldi
It works correctly and compiles well as well. Only the way to access the arguments does not seem to be so simple
– Patrick Machado