Ubuntu10.04中编译openssl遇到的问题与解决

写在前面:

仅解决遇到的两个问题,安装即配置过程自行查询,推荐:传送门

root@est-desktop:/home/est/ACE_wrappers# uname -a

Linux est-desktop 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:09:38 UTC 2010 x86_64 GNU/Linux

遇到的问题1:

openssl编译出错:

/usr/local/bin/perl bn_prime.pl >bn_prime.h /bin/sh: /usr/local/bin/perl: not found

解决:

需要安装编译环境:

由于ubuntu环境较old,所以需要更换源:传送门

sudo apt-get install build-essential

遇到的问题2:

bn_prime.c: In function ‘BN_is_prime_fasttest_ex’:

bn_prime.c:265: error: ‘NUMPRIMES’ undeclared (first use in this function)

bn_prime.c:265: error: (Each undeclared identifier is reported only once

bn_prime.c:265: error: for each function it appears in.)

bn_prime.c:266: error: ‘primes’ undeclared (first use in this function)

bn_prime.c: In function ‘probable_prime’:

bn_prime.c:380: error: ‘NUMPRIMES’ undeclared (first use in this function)

bn_prime.c:387: error: ‘primes’ undeclared (first use in this function)

bn_prime.c: In function ‘probable_prime_dh’:

bn_prime.c:431: error: ‘NUMPRIMES’ undeclared (first use in this function)

bn_prime.c:434: error: ‘primes’ undeclared (first use in this function)

bn_prime.c: In function ‘probable_prime_dh_safe’:

bn_prime.c:479: error: ‘NUMPRIMES’ undeclared (first use in this function)

bn_prime.c:484: error: ‘primes’ undeclared (first use in this function)

::就是说很多未定义的变量

解决:

win下解压0.9.8c的源码,用VScode打开发现这些变量都有定义,然后就顺手看了下linux中文件,令人诧异,竟然是空的

Ubuntu10.04中编译openssl遇到的问题与解决_第1张图片

随后将win下解压的文件复制到linux下对应的位置,就OK了。

 

而后再回到编译目录

root@est-desktop:/home/est/openssl-0.9.8c#make clean

root@est-desktop:/home/est/openssl-0.9.8c#make

......

make[2]: Leaving directory `/home/est/openssl-0.9.8c/test'

make[1]: Leaving directory `/home/est/openssl-0.9.8c/test'

making all in tools...

make[1]: Entering directory `/home/est/openssl-0.9.8c/tools'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/home/est/openssl-0.9.8c/tools'

root@est-desktop:/home/est/openssl-0.9.8c#

root@est-desktop:/home/est/openssl-0.9.8c#make install

就安装OK

 

你可能感兴趣的:(环境搭建,Linux)