fliter
unread,Aug 10, 2023, 6:12:23 AM8/10/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
I have a project that uses CGO. After compiling on an ubuntu 20.04 compilation machine, it is distributed to other machines for execution, but many of these machines have very low ubuntu versions, which may be ubuntu 16.04 or ubuntu 18.04.
In this way, when executing the binary file, an error similar to version `GLIBC_2.29' not found will be reported.
I try to use -a -ldflags '-extldflags "-static"' when go build. But it seems that because of the use of cgo, it cannot be compiled successfully.
Is there any good way, such as adding appropriate tags when go build, to solve this problem?