Cannot find libcrypto in Ubuntu
140,282
Solution 1
I solved this on 12.10 by installing libssl-dev.
sudo apt-get install libssl-dev
Solution 2
ld
is trying to find libcrypto.so
which is not present as seen in your locate
output.
You can make a copy of the libcrypto.so.0.9.8
and name it as libcrypto.so
. Put this is your ld path. ( If you do not have root access then you can put it in a local path and specify the path manually )
Related videos on Youtube
Comments
-
Limavolt over 3 years
I want to try one program which have makefile on it but when I put
make
in the shell the error was:g++ -g -DaUNIX -I../../acroname/aInclude -I../../acroname/aSource -Wl,-rpath,. unix_aLaserDemo_Data/aLaserDemo.o unix_aLaserDemo_Data/acpLaser.o -lpthread -lcrypto -lssl -o ../../acroname/aBinary/aLaserDemo /usr/bin/ld: cannot find -lcrypto collect2: ld returned 1 exit status
Here is the makefile:
CC = g++ CFLAGS = -DaUNIX -I../../acroname/aInclude -I../../acroname/aSource LFLAGS = -Wl,-rpath,. SRC = ../../acroname/aSource BIN = ../../acroname/aBinary LIBS = -lpthread -lcrypto -lssl \ #LIBS = -lpthread\ -L../../acroname/aBinary -l aUtil -l aIO OBJ = unix_aLaserDemo_Data .PHONY : app app : $(OBJ) $(BIN)/aLaserDemo $(OBJ) : mkdir $(OBJ) $(BIN)/aLaserDemo : $(OBJ)/aLaserDemo.o $(OBJ)/acpLaser.o $(CC) -g $(CFLAGS) $(LFLAGS) $^ $(LIBS) -o $@ $(OBJ)/aLaserDemo.o : aLaserDemo.cpp $(CC) -c $(CFLAGS) $< -o $@ $(OBJ)/acpLaser.o : $(SRC)/acpLaser.cpp $(SRC)/acpLaser.h $(CC) -c $(CFLAGS) $< -o $@ .PHONY : clean clean : rm -rf $(OBJ) rm -f $(BIN)/aLaserDemo
I try to locate the crypto library:
/usr/lib/i486/libcrypto.so.0.9.8 /usr/lib/i586/libcrypto.so.0.9.8 /usr/lib/i686/cmov/libcrypto.so.0.9.8 /usr/lib/libcrypto.so.0.9.8
What should I do to fix it?
-
Limavolt over 11 yearshow we know it is 64 bits or 32 bit? I am beginner in linux.
-
Jonathan Leffler over 11 yearsYou need to install the development code (package) for the crypto library. Specifically, you need
/usr/lib/libcrypto.so
(no numerical suffix) pointing at (symlinked to)/usr/lib/libcrypto.so.0.9.8
. The linking process looks for a name ending.so
; the run-time looks for the name with the versioned suffix. Thedevel
package will ensure the right links are created for development with the crypto library; what you have at the moment is only for the runtime. -
perreal over 11 yearsyou can do
uname -a
to check if it is 64bit. Also dosudo apt-get install libssl-dev
to install development package. -
Limavolt over 11 yearsunfortunatly I have not a root access. I try to #LIBS = -lpthread -lcrypto -lssl \ and change to LIBS = -lpthread\ but there are much more errors occur
-
Limavolt over 11 yearsWhen I do uname -a the result is : Linux pc4268 2.6.20-16-generic #2 SMP Sun Sep 23 19:50:39 UTC 2007 i686 GNU/Linux
-
Admin over 11 yearsTry adding
-L/usr/lib/i686/cmov
toLFLAGS
. While the compiler (linker) should automatically pick up/usr/lib/libcrypto
, the latter's probably a symbolic link to one of the others. See if pointing to such an explicit directory works. -
Limavolt over 11 yearsThank you Evert I add and here the result. /usr/bin/ld: .: No such file: File format not recognized
-
-
ThunderPhoenix over 9 yearsCan you specify how to put
libcrypto.so
in ld path ? -
Scrooge McDuck almost 2 yearsthis is so unintuitive