C++使用RabbitMQ类库做客户端与RabbitMQ Server通讯,生成C++可调用的rabbimq.*.dll的过程...

Step:

  1. download the latest rabbitmq-c via: https://github.com/alanxz/rabbitmq-c
  2. follow the document, download the cmake tool, make sure the right version of cmake. https://cmake.org/
  3. install the C compiler, if developed by VS2012, so set MSVC110=VS2012
  4. convert rabbitmq-c to C++ project via cmake command
    1. create "build" folder to rabbitmq-c root folder, then new bat file with below comman:
      REM -- create and put into /rabbitmq-c-0.9.0/build folder, then run the bat
      REM -- -DENABLE_SSL_SUPPORT=OFF disable SSL feature, otherwise will occur ssl error
      REM -- -G "Visual Studio 11 2012" , set the build environment
      cmake .. -DENABLE_SSL_SUPPORT=OFF -G "Visual Studio 11 2012"
      pause

       

  5. open the C++ project generate in step 4, then build rabbitmq project with Release version
  6. rename the rabbitmq.*.dll to rabbitmq.1.dll, then replace to the target folder

 

Troubleshooting:

  1. "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY) (found suitable version "0.9.8h", minimum required is "0.9.8")"
    1. Solution1: add OPENSSL_ROOT_DIR command to bat file: -DOPENSSL_ROOT_DIR="C:\Users\zhengs\Downloads\openssl-0.9.8k_WIN32" https://stackoverflow.com/questions/16248775/cmake-not-able-to-find-openssl-library
    2. Solution2: Disable SSL suppport, add  "-DENABLE_SSL_SUPPORT=OFF" to command. https://github.com/conetix/librabbitmq

转载于:https://www.cnblogs.com/zhengshuangliang/p/10039337.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值