I used swig
to wrap c++
in my golang
project, I find that golang
build can do separately:
- generate object file
- link the object file to binary file
like this(I get these from makefile):
go tool compile -pack -o runme.o runme.go
go tool link -linkmode external -extld "g++" -extldflags "-I/include/boost-0" -o runme runme.o
Anyway this works fine, but now I am facing a situation, I have to generate c-share
library. I know that go build
support -buildmode=c-shared
.
So can I link the object runme.o
file to librunme.so
?