Best current option for C++ interop?

Cxx.jl does not support Julia 1.5. What’s the best option calling using C++ libraries? Should I use (plain) C as the bridge?

3 Likes

I don’t know how good it is but there is CxxWrap.jl.

3 Likes

CxxWrap is cool but kind of painful to set up. In the past I ended up writing an extern C wrapper, compiled it in a dll and then used Julia’s native C calling. I would say for some tasks it’s less effort and more robust since you rely on the native Julia C interop. For me it worked because I didn’t need to use objects, I could simply expose methods and do my job. Ymmv

2 Likes

Similar to Iulian.Cioarca’s approach. I write a thin c wrapper layer called by ccall for C++ code. It works great and is very stable across Julia versions. I also tried Cxx and CxxWrap. I would say they are still kinda in their early stage. CxxWrap has gone through plenty of progress recently though. But I would still choose julia’s C call now.

1 Like