C语言 在 Ubuntu 中找不到 libcrypto

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13811889/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 04:43:30  来源:igfitidea点击:

Cannot find libcrypto in Ubuntu

cgccubuntu

提问by Limavolt

I want to try one program which have makefile on it but when I put makein the shell the error was:

我想尝试一个带有 makefile 的程序,但是当我放入makeshell 时,错误是:

 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?

我应该怎么做才能修复它?

回答by Patrick T. Anderson

I solved this on 12.10 by installing libssl-dev.

我在 12.10 上通过安装 libssl-dev 解决了这个问题。

sudo apt-get install libssl-dev

回答by shrinidhi joshi

ldis trying to find libcrypto.sowhich is not present as seen in your locateoutput. You can make a copy of the libcrypto.so.0.9.8and 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 )

ld正在尝试查找libcrypto.so您的locate输出中不存在的内容。您可以制作 的副本并将其libcrypto.so.0.9.8命名为libcrypto.so。把这是你的ld路径。(如果您没有 root 访问权限,则可以将其放在本地路径中并手动指定路径)