gcc linker can't find libcrypto, but finds libssl in the same folder.

Brant Sears brant@mac.com
Mon Oct 15 21:55:00 GMT 2007


Hi. I hope someone can help me I've been having some trouble getting linking to work.

I am trying to compile a Qtopia based application on a Linux PC that targets an ARM-davici architecture.

Things were going OK (i.e.  I was getting my app to compile, link, and run) up until recently when I needed to add some libraries that use openssl. I'm using the same stuff on other platforms without a lot of problems.

The issue I'm having is that I get an error from the linker saying that libcrypto.so.0.9.8 can't be found and it is required by libssl.so.0.9.8. The libcrypto.so.0.9.8 library is in the same folder as the libssl.so.0.9.8. This location is the location of other libraries that I'm using. This path was explicitly added to the project. (The path where ssl and crypto reside is "/usr/arm-davinci-linux/local/lib" which is referenced in the g++ call below.

It was installed into this location by runnng  configure/make/sudo make install of openssl. 

Here is the relevant portion of the error I get from running make:

arm-davinci-linux-g++ -Wl,-rpath,/usr/arm-davinci/local/Trolltech/QtopiaCore-4.3.0-generic/lib -o m3cg ChannelGuide.o main.o ChannelListHandler.o ChannelRecord.o STB.o Credentials.o ProgressSpinner.o MyThread.o DynamicConfigFetcher.o moc_ChannelGuide.o moc_STB.o moc_Credentials.o moc_ProgressSpinner.o moc_MyThread.o moc_DynamicConfigFetcher.o qrc_Common.o    -L/usr/arm-davinci/local/Trolltech/QtopiaCore-4.3.0-generic/lib -L/home/bsears/v0.11.2-A125-opera-gogi-ami_wm-subs-sdk/lib -L/home/bsears/src/aminoscreen/arm-davinci -L/usr/arm-davinci-linux/local/lib -laminoscreen -lgfx -ldebug -litype -lmpeg -ltsi -lrfmod -ltv -lavdel -lnet_utils -lconfig -lbootflash_access -lcrypto -lvsp2-session -lvsp2 -lvmxla -lvmap -lvmxnet -lvmx -lssl -lQtXml -L/usr/arm-davinci/local/Trolltech/QtopiaCore-4.3.0-generic/lib -lQtGui -lQtNetwork -lQtCore -lm -lrt -ldl -lpthread
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/arm-davinci-linux/lib/gcc/arm-davinci-linux/3.4.5/../../../../arm-davinci-linux/bin/ld: warning: libcrypto.so.0.9.8, needed by /usr/arm-davinci-linux/local/lib/libssl.so, not found (try using -rpath or -rpath-link)
/usr/arm-davinci-linux/local/lib/libssl.so: undefined reference to `RSAPrivateKey_dup'
/usr/arm-davinci-linux/local/lib/libssl.so: undefined reference to `X509_VERIFY_PARAM_inherit'
(many more undefined symbol errors follow)

I use gcc a lot, but I am unfamiliar with this problem. Are there some steps I can use to troubleshoot this? It surprises me that it finds libssl and not libcrypto in the same folder. Is this really the problem? I'm not familiar with the -rpath or -rpath-link suggestion that was made by gcc - I don't know what that is or how to add it. What should I do?

Thanks for any assistance.

Brant Sears



More information about the Gcc-help mailing list