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

Closed
Yadavdeepak007 opened this issue Sep 24, 2020 · 1 comment

Comments

@Yadavdeepak007
Copy link

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.
//test.go
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 libTest.so 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

@ALTree
Copy link
Member

ALTree commented Sep 24, 2020

Hi,

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 as completed Sep 24, 2020
@golang golang locked and limited conversation to collaborators Sep 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants