I’m completely new to this language so pardon my ignorance. I did googling but came up short. In my specific case there are some simple classes (no templates or macros involved) that I want to use on the C++ side and the Zig side and I was wondering if/how this could be made possible.
Can I just add the C++ class (.cpp, .h) to the zig compiler command? Like, “zig MyZigSourceFile MyCppClass”?
not on the immediate roadmap due to c++ being an exponentially more complex language that c, but always open to contribution
To use C++ code from Zig, it is necessary to first wrap the C++ in a pure C API/ABI. Zig does not support the C++ ABI, only the C ABI.
However it is very much possible to compile/link C++ code using the zig toolchain.