Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use shared library which build from go build -builmode=shared -linkshared directoryname #41605

Yadavdeepak007 opened this issue Sep 24, 2020 · 1 comment


Copy link

@Yadavdeepak007 Yadavdeepak007 commented Sep 24, 2020

I created main.go , in main i called a function Sample() .
package main
func main(){
// call Sample
i have created Test directory in goworkspace/src .in Test i have have test.go file.
package Test
import "fmt"
func Sample(){
fmt.Println("call Sample function")
I created .so file of Test directory by using go build -builmode=shared -linkshared Test. This command create file in goworkspace/pkg/linux_amd64_dynlink. i want to use Sample function inside the main.
how can i link this shared library with my main function and call Sample function.

Go version - 1.15.1 linux/amd64

Copy link

@ALTree ALTree commented Sep 24, 2020


the Go project does not use its bug tracker for general discussion or asking questions about the language. The Github bug tracker is only used for tracking bugs and proposals going through the Proposal Process.

Please see the Questions wiki page; it has a list of good places for asking questions. Thanks!

Closing here, since this is not a bug.

@ALTree ALTree closed this Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.