Is it possible to P/Invoke a pure C++ library, or does it have to be wrapped in C?
C++ libraries can be P/invoked, but you'll need to use "depends" to find the mangled method names (names like "@0!classname@classname@zz") and for instance methods use "ThisCall" calling convention in the p/invoke and pass the reference of the instance as the first argument (you can store the result of the constructor within an IntPtr).
A "pure" C++ library will have its name mangled by the compiler, so it will be hard to get the P/Invoke declaration correct. And a C method gets an underscore at the beginning, which may not be there in C++. And a C++ method needs a this instance as a first parameter, you'd have to give it yourself.
I think that you need to wrap your C++ API in a C-compatible series of methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With