AMQP-CPP RabbitMQ Build与CPP项目集成

时间:2017-11-23 13:58:00

标签: c++ amqp

您好我目前正尝试通过AMQPCPP将RabbitMQ集成到我的VisualStudio项目中。我被限制使用Windows PC,这对安装来说很麻烦。 我想我能够使用CMAKE构建项目Build但是我收到了一些错误Error CMAKE GUI。现在我试图将构建包含在VS2017项目中。在自述文件https://github.com/CopernicaMarketingSoftware/AMQP-CPP中,这是使用

完成的
import os
os.chdir("X:\Enter location of .bat file")
os.startfile("ask.bat")

但是我的版本中找不到此标题。我不习惯CPP所以我希望我没有做过一些基本的错误。提前谢谢!

1 个答案:

答案 0 :(得分:1)

在Windows中使用CMake构建AMQP-CPP的步骤-Visual Studio 2017

打开命令提示符并切换到AMQP-CPP git /源路径。

1)> mkdir构建

2)> cd版本

3)> cmake -G“ Visual Studio 15 2017 Win64” .. \

    -- Selecting Windows SDK version 10.0.15063.0 to target Windows 6.1.7601.
    -- The C compiler identification is MSVC 19.10.25019.0
    -- The CXX compiler identification is MSVC 19.10.25019.0
    -- Check for working C compiler: E:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.10.25017/bin/HostX86/x64/cl.exe
    -- Check for working C compiler: E:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.10.25017/bin/HostX86/x64/cl.exe -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: E:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.10.25017/bin/HostX86/x64/cl.exe
    -- Check for working CXX compiler: E:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.10.25017/bin/HostX86/x64/cl.exe -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Configuring done
    -- Generating done
    -- Build files have been written to: D:/Projects/AMQP-CPP/build

4)> cmake --build。 --target ALL_BUILD --config RELEASE --clean-first-/ m

构建成功。

   "D:\Projects\AMQP-CPP\build\ALL_BUILD.vcxproj" (default target) (1) ->       "D:\Projects\AMQP-CPP\build\amqpcpp.vcxproj" (default target) (3)        ->       (ClCompile target) ->
     D:\Projects\AMQP-CPP\src\deferredreceiver.cpp(48): warning C424
   4: 'argument': conversion from 'uint64_t' to 'uint32_t', possible loss o
   f data [D:\Projects\AMQP-CPP\build\amqpcpp.vcxproj]

1 Warning(s)
0 Error(s)

经过的时间00:00:44.16

如何在项目中包含amqpcpp

编辑您的项目CMakeLists.txt文件,以添加amqpcpp包含链接的路径和库路径。

    include_directories(../include)
    link_directories(../build/bin/Release)

包含和链接目录路径可能会根据计算机中的实际位置而有所不同。