[clue-tech] Forcing gcc compiler to link against specific so library?

marcus hall marcus at tuells.org
Thu Jan 5 20:07:07 MST 2006


On Thu, Jan 05, 2006 at 06:16:39PM -0700, Jim Ockers wrote:
> Hi,
> 
> Does anyone know how to force the linker/dynamic loader to use a
> specific (older) version of a library when two versions are present
> on the compiler system?
> 
> We compile an application that has -lcrypto in the compiler/linker
> command line.  It is dynamically linked.  The development systems
> have these libcrypto:
> 
> -rwxr-xr-x    1 root     root       918752 Sep  7  2001 /lib/libcrypto.so.0.9.6b
> -rwxr-xr-x    1 root     root      1118600 Mar 11  2005 /lib/libcrypto.so.0.9.7a
> lrwxrwxrwx    1 root     root           19 Jun 14  2004 /lib/libcrypto.so.2 -> libcrypto.so.0.9.6b
> lrwxrwxrwx    1 root     root           19 Jun 20  2005 /lib/libcrypto.so.4 -> libcrypto.so.0.9.7a
> 
> Our application would link just fine against libcrypto.so.2 but
> because libcrypto.so.4 is present on the system (and needed for
> a different application) this application always links against
> libcrypto.so.4 .

One way to do this is instead of "-lcrypto", use "/lib/libcrypto.so.2".
Another way is to create a directory with a symlink

dumylib:
	libcrypto.so -> /lib/libcrypto.so.2

Then, use "-Ldumylib -lcrypto".

-- 
Marcus Hall
marcus at tuells.org

_______________________________________________
CLUE-tech mailing list
CLUE-tech at cluedenver.org
http://cluedenver.org/mailman/listinfo/clue-tech



More information about the clue-tech mailing list