Albert Strasheim
unread,Dec 9, 2010, 7:38:16 AM12/9/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-dev
Hello all
I am playing with the new cgo.
Consider the case where you have two packages, pkg1 and pkg2, that
both call the same C function in the same library.
If a binary imports both packages, you get an error at link time:
pkg2.a(pkg2.cgo2.o): duplicate definition of _cgo_Cfunc_somefunc
Maybe this falls under the "don't do that" category, but I can think
of cases where you might want to do this, e.g., wrapping a big C
library as multiple packages and calling some general C code from all
the subpackages.
rsc?
Regards
Albert