Open JoyceBabu opened 7 years ago
I was able to compile it by setting LDFLAGS="-static -lz"
It is not working when I try to use it in my CI tool.
You need to pass --static
to pkg-config
to properly get dependencies when building static binary
pkg-config --libs --static libpng
I worked around by adding LDFLAGS="-static -lpng12 -lz -lm"
Do you want a static binary (ie. one that doesn't dynamically link in anything, not even libc
) or a binary that doesn't dynamically link in libpng
? If latter, then this is what you get when you compile with Bazel. Would that work for you?
Be good if there was simply an amd64 static binary distribution. Would make it easier to deploy in a AWS Lambda function for e.g.
@robryk I was trying to generate a static binary. I want to compile on Ubuntu and be able to use it on Ubuntu and CentOS.
How can I build a static binary executable?
I tried using
LDFLAGS=-static
and it is failing with the following error