(ubuntu)下编译安装gsoap_2.8.21问题汇总

来源:互联网 发布:linux 非法图像文件 编辑:程序博客网 时间:2024/06/03 18:21
没试过gsoap的每个版本,但我记得当时使用gsoap2.8.10的时候,里面的 soapcpp2, wsdl2h工具是直接有的,不需要自己编译,好像更高版本之后在linux下使用都需要自己编译生成这两个工具,一般第一次编译都会出现出现以下问题
下载gsoap_2.8.21.zip 并 解压 : $unzip gsoap_2.8.21.zip
解压后的目录统一都是gsoap-2.8
进入该目录:$cd gsoap-2.8
 
如果g++已经安装的,跳过 第1步,直接到第2步骤进行编译,直接make
1.自动配置编译环境:  $./configure –prefix=$(pwd)/_install 
 
配置失败
  • 原因:error: C++ compiler cannot create executables
  • 解决办法:You need to install c++ on your computer. even if you installed gcc that doesn’t automatically install g++. Try to run one of the following commands that fit your Linux distribution best :)
  • yum install gcc-c++ or apt-get install gcc-c++ . if apt-get doesn’t like the command try :apt-get install g++
安装c++编译器 : $sudo apt-get install g++

重新执行配置命令,成功!

2.编译安装 : $sudo make

 
编译出错 : yacc: 未找到命令 , 需要安装yacc
yacc和lex在ubuntu使用flex和bison代替,此处安装bison就是安装yacc
执行命令 : $sudo apt-get install bison

安装完成后继续编译,结果出错:

很明显,需要安装flex : sudo apt-get install flex

继续编译,继续出错 :

原因:缺少openssl,安装openssl : suod apt-get install openssl

网上还说要安装openssl的库文件 : sudo apt-get install libssl-dev

出错 
sudo apt-get install libgtk2.0-dev libglib2.0-dev
编译成功!

3.安装  sudo make install

 
总结 : 
          1.安装编译工具 : $sudo apt-get install g++ 或者 $sudo apt-get install build-essential
          2.可能需要安装GTK+和Glib库 : $sudo apt-get install libgtk2.0-dev libglib2.0-dev
          3.安装flex和bison代替lex和yacc :  $sudo apt-get install flex bison
          4.安装openssl      :   $sudo apt-get install openssl
                                        $sudo apt-get install libssl-dev
          5.不能有中文路径
0 0