有没有办法从 Go 调用 C++ 代码?我需要在 Windows 和 Mac 中调用 C++ 代码。 Go语言支持跨语言集成吗?
最佳答案
Go is a compiled language, not a scripting language. However, it does not support direct calling of functions written in C/C++. The cgo program may be used to generate wrappers to call C code from Go, but there is no convenient way to call C++ code. SWIG fills this gap.
使用 SWIG。
关于c++ - golang : call C++ code in cross platform,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22124781/