shared libraries and dynamic loading?

1,073 views
Skip to first unread message

Tom

unread,
Nov 12, 2009, 12:30:58 AM11/12/09
to golang-nuts
Is there any support for compiling Go programs into shared libraries?

What about loading Go libraries into Go programs dynamically?

Finally, what about something analogous to pinvoke; that is, load a C
library dynamically and then call functions in it?

Based on the documentation, these don't seem implemented yet., but
what are the plans?

Ian Lance Taylor

unread,
Nov 12, 2009, 12:41:17 AM11/12/09
to Tom, golang-nuts
Tom <tmb...@gmail.com> writes:

> Is there any support for compiling Go programs into shared libraries?

Not at present (unless you use gccgo).

> What about loading Go libraries into Go programs dynamically?

Sort of but I don't know if anybody has tested it.

> Finally, what about something analogous to pinvoke; that is, load a C
> library dynamically and then call functions in it?

Yes, see misc/cgo.

> Based on the documentation, these don't seem implemented yet., but
> what are the plans?

The plans are to permit loading C libraries dynamically and calling
them.

Ian

Jean-Lou Dupont

unread,
Nov 18, 2009, 11:17:21 AM11/18/09
to golang-nuts
I didn't find an "issue" related to this feature so I created one:
http://code.google.com/p/go/issues/detail?id=256
Reply all
Reply to author
Forward
0 new messages