环境:虚拟机 centos 6.5
编译之前需要准备软件安装环境
1.安装Bison
我采用源码编译安装的方式:
官网:http://www.gnu.org/software/bison/
版本:bison-2.7.91.tar.gz
安装:详见bison-2.7.91/INSTALL说明
2.安装Flex
我采用源码编译安装的方式:
官网:http://flex.sourceforge.net/
版本:flex-2.6.0.tar.gz
安装:详见flex-2.6.0/INSTALL说明1
3. 编译安装openssl
采用命令行安装OpenSSL( yum -y install openssl ; yum -y install openssl-devel)会有以下报错
/usr/local/include/openssl/opensslconf.h:18:3: error: #error OPENSSL_ALGORITHM_DEFINES no longer supported
# error OPENSSL_ALGORITHM_DEFINES no longer supported
后采用源码安装,下载源码,我用的最新版本 https://www.openssl.org/source/openssl-1.0.2l.tar.gz
以下是编译过程:
解压
tar zxf openssl-1.0.2h.tar.gz
cd openssl-1.0.2h
.安装
./config shared zlib
make
make install
mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl /usr/include/openssl.bak
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
echo “/usr/local/ssl/lib” >> /etc/ld.so.conf
ldconfig -v
检测安装是否成功
openssl version -a
4.编译soap
下载 gsop 源码 http://sourceforge.net/projects/gsoap2
编译
cd gsoap-2.8
./configure --with-openssl=/usr/local --prefix=$(GSOAP)/build_centos (--prefix 为安装路径)
make
cd gsoap-2.8/gsoap 就可以看到编译成功的soapcpp2 和wsdl2h
如果安装失败, 报缺少工具之类的请参考https://www.genivia.com/downloads.html#unix
感谢以下网友分享:
opssl安装
http://www.cnblogs.com/nikolatesfei/p/5775229.html
gsoap 编译
http://blog.csdn.net/benkaoya/article/details/72466827