我正在尝试在我的 ubuntu 13:04 上安装一个开源项目,但是 make 过程在一个名为updateDB.c的类中的方法上失败。在编译期间,我有这个错误:
updateDB.o: In function `update_cache_hash':
/usr/local/src/bgpinspect-0.5/src/updateDB.c:142: undefined reference to `EVP_DigestUpdate'
/usr/local/src/bgpinspect-0.5/src/updateDB.c:143: undefined reference to `EVP_DigestFinal_ex'
collect2: error: ld returned 1 exit status
make[1]: *** [BGPdb] Error 1
make[1]: Leaving directory `/usr/local/src/bgpinspect-0.5/src'
make: *** [all] Error 2
这是失败的方法update_cache_hash:
static uint16_t update_cache_hash( char *buff, int size ) {
unsigned char md_hash[EVP_MAX_MD_SIZE];
unsigned int md_len;
uint16_t hash;
EVP_DigestUpdate(&global_table.ctx, buff, size );
EVP_DigestFinal_ex(&global_table.ctx, md_hash, &md_len);
if ( md_len < 2 ) {
ps_log( PS_LOG_ERROR, "EVP_DigestFinal_ex returned a short hash.\n" );
return 0;
}
hash = ( (uint16_t) md_hash[md_len - 2] << 8 ) | md_hash[md_len - 1];
hash = UPDATE_CACHE_MASK( hash );
return hash;
}
这个类的顶部有一个包含语句
#include <openssl/evp.h>
我在 libssl-dev 旁边的计算机上安装了 openssl ;我不知道为什么它会给出这个错误,因为我是 c 和静态链接等的新手。我在这条路径上有evp.h:/usr/include/openssl/evp.h
那么我如何更改 makefile 或配置以解决此问题?因为似乎 make 看不到这条路径/usr/include/openssl/evp.h