Undefined reference to EVP_idea_ecb on Debian

*爱你&永不变心* 提交于 2020-01-24 22:08:42

问题


I have the following code:

#include <stdio.h>
#include <stdlib.h>
#include <openssl/evp.h>
int main (int argc, char *argv[]) {
    EVP_CIPHER *cipher;
    EVP_idea_ecb();
}

I know, this is not much, but it should compile without complaints, but I get

gcc Testfile.c -lssl -lcrypto
Testfile.c:(.text+0xec): undefined reference to `EVP_idea_ecb'

gcc Testfile.c -lss
/usr/bin/ld: /tmp/ccgbkhFA.o: undefined reference to symbol 'EVP_CIPHER_iv_length@@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0: error adding symbols: DSO missing from command linel

libssl-dev are installed. Any ideas what is going wrong here?

My distro: Debian Jessie on x64.


回答1:


What is going on line by line:

gcc Testfile.c -lssl -lcrypto
Testfile.c:(.text+0xec): undefined reference to `EVP_idea_ecb'

OpenSSL library of Debian Jessie x64 doesn't contain EVP_idea_ecb.

gcc Testfile.c -lss
/usr/bin/ld: /tmp/ccgbkhFA.o: undefined reference to symbol 'EVP_CIPHER_iv_length@@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0: error adding symbols: DSO missing from command linel

libss.so.2.0 from libss2 command line interface library package doesn't help either.



来源:https://stackoverflow.com/questions/27903198/undefined-reference-to-evp-idea-ecb-on-debian

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!