|
|
|
|
|
by geofft
3800 days ago
|
|
Rust can call directly into a C++ library as long as it uses the C ABI: there aren't bindings to (a compiler-specific implementation of) the C++ type system. Go is just the same. This isn't really a language restriction, more a result of how rich the C type system is and how compiler-specific it is. The only languages that have direct C++ interop are those that directly use a C++ compiler (like Objective-C++). It appears that GoQt has this giant pile of wrappers around C++ types, casting pointers back and forth: https://raw.githubusercontent.com/visualfc/goqt/master/qtdrv... I would have expected this to require an `extern "C"` declaration. I'm sort of surprised it doesn't, but maybe the common C++ ABIs match the C ones if only C types are passed to and from the function? (Also, is this file auto-generated?) |
|