On 4/5/22 10:50, supsm17 wrote:
I want to static link the standard library (glibc) for my application so it could be run on older machines. I'm using cmake to build fltk and my project. Without fltk it compiles fine, but with fltk it gives the following error: /usr/bin/ld: attempted static link of dynamic object `/usr/lib/x86_64-linux-gnu/libdl.so'. I'm adding the -static flag with target_link_libraries in cmake. How would I do this for fltk, if possible?
On my system it's: /usr/lib/x86_64-linux-gnu/libdl.a
Not sure if it's an 'option' to have this file.
Looks like it's part of the "libc6-dev" package on Ubuntu
20.x:
$ dpkg -S /usr/lib/x86_64-linux-gnu/libdl.a
libc6-dev:amd64: /usr/lib/x86_64-linux-gnu/libdl.a
A cross-compiled binary from x64 to aarch64 doesn't seem to work on my raspberry pi as the glibc version is too old. I'm worried a similar thing may happen to other devices. If there's another way to get around this I'm more than happy to do it instead.