I built a wrapper for a c++ library: https://github.com/goblimey/rplidar_sdk_go. The c++ code used various features that defeated cgo, so I ended up with a multi-layered solution.
One thing I discovered is that cgo has a nasty habit of rewriting the Go code that calls C code, including trampling on your comments, so keeping that code in a separate layer is a good idea.
> To unsubscribe from this group and all its topics, send an email to golang-nuts+unsubscribe@googlegroups.com.
Undefined symbols for architecture x86_64:
"_fC", referenced from:
__cgohack_fC in _cgo_main.o
(maybe you meant: _fCPtr, __cgohack_fC , __cgohack_fCPtr )
You could export the C function in a Go wrapper in package A, and use that.
Maybe another exported Go wrapper is needed in package B, I don't know.
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/ruLltGrPWBg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/ruLltGrPWBg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.