directory
Version:
v0.0.0-...-93a105f
Opens a new window with list of versions in this module.
Published: Mar 14, 2018
License: Apache-2.0
Opens a new window with license information.
README
¶
buildshared
Files in this directory demostrate how to build shared libraries in Go and how to load then dynamically.
- How to build Go shared libraries efficiently without building all source files from scratch.
- How to dynamically load Go shared libraries.
Commands
go install -buildmode=shared -pkgdir `pwd`/cache -linkshared github.com/yunabe/golang-codelab/buildshared/lib0
go install -buildmode=shared -pkgdir `pwd`/cache -linkshared github.com/yunabe/golang-codelab/buildshared/lib1
go install -buildmode=shared -pkgdir `pwd`/cache -linkshared github.com/yunabe/golang-codelab/buildshared/lib2
go install -buildmode=shared -pkgdir `pwd`/cache -linkshared github.com/yunabe/golang-codelab/buildshared/lib3
go build -pkgdir `pwd`/cache -linkshared -o buildshareddemo github.com/yunabe/golang-codelab/buildshared/main
ldd ./buildshareddemo
./buildshareddemo
Notes
- The path for
-pkgdir
must be an absolute PATH.
Directories
¶
Click to show internal directories.
Click to hide internal directories.