You're right, and this is what is strange -- there is no /lib/libssl.so. Perhaps this means there *is* a libssl.so but in another one of the standard directories (pointing to /lib/libssl.so.4), which would be very perverse but seems possible. -----Original Message----- From: Paul Smith [mailto:paul@xxxxxxxxxxxxxxxxx] Sent: Thursday, April 28, 2011 1:22 PM To: Steve Jaffe Cc: gcc-help@xxxxxxxxxxx Subject: Re: how does linker choose version of shared lib? On Thu, 2011-04-28 at 09:57 -0700, Steve Jaffe wrote: > To be specific: I have two versions of libssl in /lib: libssl.so.4 and > libssl.so.6. What happens is that the .so.4 version is always linked -- > what determines this behavior? (and how could one therefore change it, ie > specify which version to choose?) Typically there's a symbolic link on the system "libssl.so" (note no version) which points to whichever major version you want to use as the default. This "un-versioned" .so is what's used by the compile-time linker to determine which .so to link. Look for libssl.so and see if it points to libssl.so.4 or libssl.so.6.