Ccall with return vector<double>

Hello, I have a function in a shared library (self-written) where I have a vector<double> as a return type. Now, how would I organize the ccall in order to get a `Array{Float64} in Julia.

I cannot figure it out on my own. Any help would be great. Thanks.

I tried:

ccall((:func_name, "path/to/file.so"), Ptr{Cdouble}, ())

But thid does not work and troughs a SegFault.

vector<double> is a C++ type, so presumably you’re wrapping a C++ library, not a C library. Ccall only works for C libraries, which is why you’re having problems. You’ll need to either write a C-compatible wrapper for your C++ library or use GitHub - JuliaInterop/Cxx.jl: The Julia C++ Interface

Or CxxWrap:

https://github.com/JuliaInterop/CxxWrap.jl