I'm trying to compile Go where it includes all the libraries that I need to run it. I'm trying to run the go binary in lambda so I need to add some C libraries (I think) when I build it (on linux), but when I do, I get this error:
[ec2-user@ip- src]$ go build -tags static --ldflags '-extldflags "-static -lpthread -lxml2 -lz -lm -llzma -lc"' main.go
# command-line-arguments
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -ldl
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lrt
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lxml2
/usr/bin/ld: cannot find -lz
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -llzma
/usr/bin/ld: cannot find -lc
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
---EDIT00000
I did a quick ldconfig
search? and see this for example...are these the ones I need?
ldconfig -p | grep -e xml2 -e pthread -e lzma -e dl
libxml2.so.2 (libc6,x86-64) => /lib64/libxml2.so.2
libreadline.so.6 (libc6,x86-64) => /lib64/libreadline.so.6
libpthread.so.0 (libc6,x86-64, OS ABI: Linux 2.6.32) => /lib64/libpthread.so.0
liblzma.so.5 (libc6,x86-64) => /lib64/liblzma.so.5
libhandle.so.1 (libc6,x86-64) => /lib64/libhandle.so.1
libgpgme-pthread.so.11 (libc6,x86-64) => /lib64/libgpgme-pthread.so.11
libdl.so.2 (libc6,x86-64, OS ABI: Linux 2.6.32) => /lib64/libdl.so.2
libdl.so (libc6,x86-64, OS ABI: Linux 2.6.32) => /lib64/libdl.so