[c] Cannot find libcrypto in Ubuntu

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?

This question is related to c gcc ubuntu

The answer is


I solved this on 12.10 by installing libssl-dev.

sudo apt-get install libssl-dev

ld is trying to find libcrypto.sowhich 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 )


Examples related to c

conflicting types for 'outchar' Can't compile C program on a Mac after upgrade to Mojave Program to find largest and second largest number in array Prime numbers between 1 to 100 in C Programming Language In c, in bool, true == 1 and false == 0? How I can print to stderr in C? Visual Studio Code includePath "error: assignment to expression with array type error" when I assign a struct field (C) Compiling an application for use in highly radioactive environments How can you print multiple variables inside a string using printf?

Examples related to gcc

Can't compile C program on a Mac after upgrade to Mojave Compiling an application for use in highly radioactive environments Make Error 127 when running trying to compile code How to Install gcc 5.3 with yum on CentOS 7.2? How does one set up the Visual Studio Code compiler/debugger to GCC? How do I set up CLion to compile and run? CMake error at CMakeLists.txt:30 (project): No CMAKE_C_COMPILER could be found How to printf a 64-bit integer as hex? Differences between arm64 and aarch64 Fatal error: iostream: No such file or directory in compiling C program using GCC

Examples related to ubuntu

grep's at sign caught as whitespace "E: Unable to locate package python-pip" on Ubuntu 18.04 How to Install pip for python 3.7 on Ubuntu 18? "Repository does not have a release file" error ping: google.com: Temporary failure in name resolution How to install JDK 11 under Ubuntu? How to upgrade Python version to 3.7? Issue in installing php7.2-mcrypt Install Qt on Ubuntu Failed to start mongod.service: Unit mongod.service not found