You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and I wants to build sysapi into a shared kibrary because init.so/ test.so depends on it
my step:
go install -buildmode=shared -linkshared std
go install -buildmode=shared -linkshared
What did you expect to see?
build scuccess
What did you see instead?
zylthinking@linux ~/TSConsole/code$ ls
main.go sysapi
zylthinking@linux ~/code$ go build
zylthinking@linux ~/TSConsole/code$ ls
code main.go sysapi
zylthinking@linux:~/TSConsole/code$ rm code
zylthinking@linux ~/code$ go build -buildmode=shared
no packages to build
zylthinking@linux ~/TSConsole/code$ ls
main.go sysapi
The text was updated successfully, but these errors were encountered:
ALTree
changed the title
how can I build using -linkshared in a go modules project?
cmd/go: how can I build using -linkshared in a go modules project?
Jan 10, 2019
As the documentation for -buildmode=shared says, "Packages named main are ignored." That is because it doesn't make sense to build a main package into a shared library.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
YES
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
my project tree:
├── code
│ ├── main.go
│ └── sysapi
│ ├── bitmask.go
│ ├── syslog.go
│ └── task.go
├── go.mod
├── go.sum
and I wants to build sysapi into a shared kibrary because init.so/ test.so depends on it
my step:
What did you expect to see?
build scuccess
What did you see instead?
zylthinking@linux ~/TSConsole/code$ ls
main.go sysapi
zylthinking@linux ~/code$ go build
zylthinking@linux ~/TSConsole/code$ ls
code main.go sysapi
zylthinking@linux:~/TSConsole/code$ rm code
zylthinking@linux ~/code$ go build -buildmode=shared
no packages to build
zylthinking@linux ~/TSConsole/code$ ls
main.go sysapi
The text was updated successfully, but these errors were encountered: