如何编译gSoap与在windows上启用ssl? [英] How to compile gSoap with ssl enabled on windows?

查看:1638
本文介绍了如何编译gSoap与在windows上启用ssl?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用ssl支持构建gSoap二进制文件。我已从此网站下载了WIN32 openssl的最新gSoap和二进制文件: http://slproweb.com/products/ Win32OpenSSL.html



按照 gSoap文档,我必须使用启用了DWITH_OPENSSL选项的标准过程进行编译。我认为最自然的选择是tu使用minGW,但我没有这个工具的经验。当我尝试这一点,(应用此补丁我有两个缺少的库链接时间:-lssl和-lcrypto。



我想我必须添加一个-L选项到编译指令,但我在openssl lib文件夹中看不到任何libssl或libcrypto(应该是.a还是.lib?)。我必须重新编译这些,还是我缺少一些东西?

解决方案

Ok我终于做到了,这里是我使用的不同步骤:


  1. ,我不得不重建openssl与mingw,因为静态库不附带的由发光的光生产 a>。我把openssl文件夹放在c:/ openssl /


  2. 然后,在stdsoap2.h中,我将2247行改为:

      #if defined(WIN32)&&!defined(__ MINGW32__)
    #define soap_strtoll _strtoi64
    #else
    #define soap_strtoll strtoll
    #endif

    #if定义(WIN32)&& !defined(__ MINGW32__)
    #define soap_strtoull _strtoui64
    #else
    #define soap_strtoull strtoull
    #endif


  3. 在配置文件中:




    • 我删除了所有出现的-DWITH_GZIP -lz。

    • 我添加了-lws2_32链接器选项(支持winsocket我想)
      配置文件中的这些更改是在行7338-7347:

        WSDL2H_EXTRA_FLAGS = -  DWITH_GNUTLS
      WSDL2H_EXTRA_LIBS = - lgnutls -lgcrypt -lgpg-error
      SAMPLE_SSL_LIBS = -lgnutls -lgcrypt -lgpg-error
      WSDL2H_SOAP_CPP_LIB =libgsoapssl ++。a
      else
      {echo$ as_me:$ LINENO:result:no>& 5
      echo$ {ECHO_T} no>& 6; }
      WSDL2H_EXTRA_FLAGS = - DWITH_OPENSSL
      WSDL2H_EXTRA_LIBS = - lssl -lcrypto -lws2_32
      SAMPLE_SSL_LIBS = - lssl -lcrypto -lws2_32



  4. 我在mingw中运行configure添加正确的LDFLAGS和CXXFLAGS,即:

      LDFLAGS + =-L / c / openssl / -L / c / MinGW / lib /CXXFLAGS + =-I / c / openssl / include /./configure 


  5. 我跑了,横渡了我的手指! $ b


I am trying to build gSoap binaries with ssl support. I have downloaded the latest gSoap and binaries for WIN32 openssl from this website: http://slproweb.com/products/Win32OpenSSL.html

According to the gSoap documentation, I have to compile using the standard procedure with the DWITH_OPENSSL option enabled. I think the most natural option would be tu use minGW, but I have little experience with this tool. When I try this, (and after applying this patch I am left with two missing libraries a link time: -lssl and -lcrypto.

I guess I have to add a -L option to the compiling directive, but I dont see any libssl or libcrypto (should it be .a or .lib ?) in the openssl lib folder. Must I recompile these too or am I missing something ?

解决方案

Ok I finally made it, here are the different steps I used :

  1. First, I had to rebuild openssl with mingw since the static libraries are not shipped with the binaries shipped by Shining Light Production. I put the openssl folder in c:/openssl/

  2. Then, in stdsoap2.h, I changed line 2247 to :

    #if defined(WIN32) && !defined(__MINGW32__)
    #define soap_strtoll _strtoi64
    #else
    # define soap_strtoll strtoll
    #endif
    
    #if defined(WIN32) && !defined(__MINGW32__)    
    # define soap_strtoull _strtoui64
    #else
    # define soap_strtoull strtoull
    #endif
    

  3. In the configure file:

    • I removed all occurence of -DWITH_GZIP and -lz.
    • I added the -lws2_32 linker option (support for winsocket I think) Those changes in the configure file are in lines 7338-7347 :

      WSDL2H_EXTRA_FLAGS="-DWITH_GNUTLS"
      WSDL2H_EXTRA_LIBS="-lgnutls -lgcrypt -lgpg-error"
      SAMPLE_SSL_LIBS="-lgnutls -lgcrypt -lgpg-error"
      WSDL2H_SOAP_CPP_LIB="libgsoapssl++.a"
      else
      { echo "$as_me:$LINENO: result: no" >&5
      echo "${ECHO_T}no" >&6; }
      WSDL2H_EXTRA_FLAGS="-DWITH_OPENSSL"
      WSDL2H_EXTRA_LIBS="-lssl -lcrypto -lws2_32"
      SAMPLE_SSL_LIBS="-lssl -lcrypto -lws2_32"
      

  4. I ran configure in mingw adding the proper LDFLAGS and CXXFLAGS, namely :

    LDFLAGS+=" -L/c/openssl/ -L/c/MinGW/lib/" CXXFLAGS+=" -I/c/openssl/include/" ./configure
    

  5. I ran make and crossed my finger!

这篇关于如何编译gSoap与在windows上启用ssl?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆