Are there any benefits of shared over static?
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
it's also possible for the gc toolchain (with gccgo, it's obviously possible).
for example, by using the .syso mechanism, you can include arbitrary object files into a go program. including all C/C++ source files with a cgo package is also a possible way.
i'm replying from phone, so i can't add an example here, but i think the syso trick has been explained multiple times on the mailing list.
On Mar 28, 2014 11:50 PM, "minux" <minu...@gmail.com> wrote:
> On Mar 28, 2014 5:49 AM, "Erik Aigner" <aigne...@gmail.com> wrote:
> > Is it - or will it ever be - possible to build a static library with Go?
oops, i misread your message.
if you want to build a static library, possible, but you won't be able to link library to another program due to the runtime problem others have explained.
when doing external linking, the gc toolchain actually builds a relocatable object file, but all you can do is to link it with cgo object files to produce a final executable.
what are you really trying to do?
if just statically linking C code, use cgo or syso, but if you want to embed go in, say, C program, that's not going to work at least for the current implementations.
what are you really trying to do?
what are you really trying to do?
I want to write code for data processing in Go and link it statically with an app on iOS.