版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/swjtu100/article/details/52093261
ubuntu12.04上自带安装了1.0.1版本的OpenSSL,由于需要调试1.0.1m版本的代码,所以在官网上下载openssl1.0.1m源码包进行安装。但在安装过程中出现以下错误:
md2test.c:1:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
通过google找到解决方法:
The problem is that md2test.c is actually a symbolic link, or symlink to dummytest.c.If you extracted openssl-1.0.1m.tar.gz with anything other than tar xf openssl-1.0.1m.tar.gz
then these symlinks were not preserved.
正是因为解压方式不对导致该错误,重新解压便能成功安装。安装过程如下:
- 解压文件
tar -xf openssl-1.0.1m.tar.gz
- 配置
./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl
- 编译
make
安装
sudo make install
设置环境变量
sudo gedit ~/.bashrc
在最后一行添加export PATH=/usr/local/openssl/bin:$PATH
保存退出,使用source ~/.bashrc
使其立即生效。