$ gcc -lssl -lcrypto foo.c /usr/bin/ld: /tmp/ccHvEUdz.o: in function `main': foo.c:(.text+0x13): undefined reference to `OPENSSL_init_crypto' collect2: error: ld returned 1 exit status
$ gcc --verbose -Wl,--verbose foo.c (...略...) /usr/bin/ld: mode elf_x86_64 (...略...) attempt to open /usr/lib/gcc/x86_64-linux-gnu/11/libssl.so failed attempt to open /usr/lib/gcc/x86_64-linux-gnu/11/libssl.a failed attempt to open /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/libssl.so succeeded /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/libssl.so attempt to open /usr/lib/gcc/x86_64-linux-gnu/11/libcrypto.so failed attempt to open /usr/lib/gcc/x86_64-linux-gnu/11/libcrypto.a failed attempt to open /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/libcrypto.so succeeded /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/libcrypto.so (...略...) /usr/bin/ld: /tmp/ccJpwMbq.o: in function `main': foo.c:(.text+0x13): undefined reference to `OPENSSL_init_crypto' /usr/bin/ld: link errors found, deleting executable `a.out' collect2: error: ld returned 1 exit status