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?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/04a8f645-56c7-45b7-938e-3bdaa4b4fa97n%40googlegroups.com.

Reply via email to