Calling Go code from C++

shazni nazeer
CodeX
Published in
7 min readAug 11, 2023

--

In a previous post I wrote on how you can can call a C code from Go. In this post I’m going to show you how to do the reverse. Since C++ has similarities with C and much more it would be interesting to see how we could do it from C++ instead. That way we can expand the discussion to interesting areas such as involving classes.

Well what makes this possible is the ‘cgo’ library module in Go. It can build a Go code as a C…

--

--