buildshared/

directory
v0.0.0-...-93a105f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2018 License: Apache-2.0

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

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL