I am trying to compile an statically-linked executable, but I cannot seem to avoid producing a dynamically-linked one instead. I tried this compilation command first:
gcc -o test test.c -lcrypto -ldl -lz -static-libgcc
I have also tried just -static
and --disable-shared
with the same results. I thought the above command would be enough to produce a static executable, but the file
command tells me that the result is dynamically linked.
Can anyone shed some light on what I am doing wrong?