Is it possible to compile the go code into .lib/dll/so so that I can use them in cpp?

Is it possible to compile the go code into .lib/dll/so so that I can use them in cpp?

Yes and no. There are the build modes “c-archive” and “c-shared” that’ll build static and dynamic libraries for use from C. However this is currently supported on linux-amd64 and darwin-amd64 only, if I remember correctly. Here’s the first Google hit on it, which shows how to use it (although from 2015, so some details may have changed):

http://blog.ralch.com/tutorial/golang-sharing-libraries/

Thank you very much for the reply!
I will look into cgo further and update this post if I have any new findings.

Best Regards,

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.