您好我目前正尝试通过AMQPCPP将RabbitMQ集成到我的VisualStudio项目中。我被限制使用Windows PC,这对安装来说很麻烦。 我想我能够使用CMAKE构建项目但是我收到了一些错误。现在我试图将构建包含在VS2017项目中。在自述文件https://github.com/CopernicaMarketingSoftware/AMQP-CPP中,这是使用
完成的import os
os.chdir("X:\Enter location of .bat file")
os.startfile("ask.bat")
但是我的版本中找不到此标题。我不习惯CPP所以我希望我没有做过一些基本的错误。提前谢谢!
答案 0 :(得分:1)
打开命令提示符并切换到AMQP-CPP git /源路径。
-- 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
构建成功。
"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
编辑您的项目CMakeLists.txt文件,以添加amqpcpp包含链接的路径和库路径。
include_directories(../include)
link_directories(../build/bin/Release)
包含和链接目录路径可能会根据计算机中的实际位置而有所不同。