Qpid第一课 Windows编译C++/ Qpid Client
更新:HHH   时间:2023-1-7


官网链接 http://qpid.apache.org/components/messaging-api/index.html
源码包  qpid-cpp-1.36.0.tar.gz
生成解决方案工具 CMake


 1)浏览编译文档
    INSTALL-WINDOWS.txt文档描述了Windows编译Qpid的操作步骤以及注意事项,当前采用的是Microsoft Visual Studio 2015(VC14)编译Qpid,文档指定的编译器是Microsoft Visual Studio 2012(VC11)

2)编译依赖库
Qpid源码编译依赖库:
 * boost      <http://www.boost.org>                    (1.58)
 * CMake      <http://www.cmake.org>                    (3.2)
 * python     <http://www.python.org>                   (2.7.10)
 * ruby       <http://www.ruby-lang.org>                (2.2.2)
当前使用的是boost_1_59_0版本,CMake3.10.0rc1版本

如下库是可选的,所以没有安装
 * swig       <http://www.swig.org>                     (2.0.10)
 * perl       <http://www.perl.HELPME>                  (1.2.3)
 * nunit      <http://www.nunit.HELPME>                 (2.5.8)
 * doxygen

3) 默认选择生成的编译错误
选择创建BUILD_BINDING_DOTNET,出现如下的生成错误
Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR)
Building Dotnet bindings
CMake Error at bindings/qpid/dotnet/CMakeLists.txt:197 (message):
  No DOTNET binding support available for Visual Studio 14 2015
由于没有安装SWIG软件库,导致VS2015缺乏DOTNET binding套件,因此需要在CMake的配置选项中剔除BUILD_BINDING_DOTNET

选择创建BUILD_AMQP,出现如下的生成错误
CMake Error at src/amqp.cmake:47 (message):
  Qpid proton not found, required for amqp 1.0 support
Call Stack (most recent call first):
  src/CMakeLists.txt:591 (include)
由于没有安装Qpid proton,因此需要在CMake的配置选项中剔除BUILD_AMQP

CMake Deprecation Warning at CMakeLists.txt:138 (cmake_policy):
  The OLD behavior for policy CMP0022 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
编译提醒:OLD语言特性即将在下一个CMake版本剔除,CMake3.2版本不会出现这个问题,不影响解决方案的生成

注意
一般情况下,在qpid-cpp-1.36.0目录下创建build文件夹应用于VS解决方案生成
CMake配置如下:
Where is the source code:E:/bin/qpid-cpp-1.36.0
Where is build the binaries:E:/bin/qpid-cpp-1.36.0/build
BUILD_BINDING_DOTNET 取消编译


返回编程语言教程...