could not be found

I get the error below when I run a Go executable on one machine, when compiled using 1.15.5, but it works fine when using 1.14.12. This confuses me, I thought that go executables where statically linked an did not have any dependencies?

./ /lib/x86_64-linux-gnu/ version `GLIBC_2.32’ not found (required by ./

The machine I am compiling on runs Manjaro Cinnamon, and the computer where the problem occurs runs Linux Mint 20.

What is it that I am not understanding here? Are go executables not “independent”?

I think there are some things in Go that use libc like the net and os/user packages (I think that’s one of the reasons that the race detector doesn’t work when you use the net package). If you’re not using these packages, then your program can be statically compiled, or there might be some compile-time options to use pure-Go versions of these packages. I’m still reading through some of the bug reports about it like this one.

From what I can see, I am not using net or os/user in this particular executable.

When you are saying “can be compiled statically”, does that mean that I need to add an argument to my go build statement to make it compile statically?


Based on what I’m seeing in, you reference internal/softtube.core and that references which uses the net package.

1 Like

And I’ll admit that I don’t really know a lot about static vs. dynamic linking, but it’s my understanding is the net package uses cgo to handle some of the calls to the operating system (I believe, for example, resolving hostnames to IP addresses lookup) and that it does so through libc.

EDIT: Also, regarding the options, I think you could disable cgo by setting CGO_ENABLED=0 before your go build command. I *think* cgo is the only place you get dynamic linking that you have to explicitly opt out of.

Obviously I am not very good at reading my own code :slight_smile:


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.