【原创】如何正确生成RabbitMQ-C客户端库

关键点:

1. 下载 rabbitmq-c-master 源码
2. 下载 rabbitmq-codegen 源码
3. 将 rabbitmq-codegen 中的内容拷贝到 rabbitmq-c-master 中的 codegen 目录下(如果没有该目录请自行创建)

4. 通过 win32 的 cmd 或者 cmake-gui 执行相应的命令进行相关文件生成。
5. 下载的 rabbit-c-master 源码中没有文件 amqp_framing.h 和 amqp_framing.c,这两个文件是通过 codegen.py 和 amqp_codegen.py 产生的。
6.使用 CMake 时路径中最好不要出现中文。
7.rabbitmq-c 库对于线程问题说明值得注意。


如下是通过 cmake-gui 生成 VS2008 工程的生成日志:
The C compiler identification is MSVC 15.0.21022.8
Check for working C compiler using: Visual Studio 9 2008
Check for working C compiler using: Visual Studio 9 2008 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Found C inline keyword: __inline
Looking for htonll
Looking for htonll - not found
Found PythonInterp: C:/Python27/python.exe (found version "2.7.3") 
Found amqp_codegen.py in D:/RabbitMQ/C_Client/test/rabbitmq-c-master/codegen
Could NOT find POPT (missing:  POPT_INCLUDE_DIR POPT_LIBRARY) 
Could NOT find XmlTo (missing:  XMLTO_EXECUTABLE) 
   Entering             D:/RabbitMQ/C_Client/test/rabbitmq-c-master/librabbitmq
   Returning to         D:/RabbitMQ/C_Client/test/rabbitmq-c-master
   Entering             D:/RabbitMQ/C_Client/test/rabbitmq-c-master/examples
   Returning to         D:/RabbitMQ/C_Client/test/rabbitmq-c-master
   Entering             D:/RabbitMQ/C_Client/test/rabbitmq-c-master/tests
   Returning to         D:/RabbitMQ/C_Client/test/rabbitmq-c-master
Building rabbitmq as a shared library - yes
Building rabbitmq as a static library - no
Configuring done

如下是通过打开 VS2008 工程编译时的输出:
1>------ 已启动全部重新生成: 项目: ZERO_CHECK, 配置: Debug Win32 ------
1>正在删除项目“ZERO_CHECK”(配置“Debug|Win32”)的中间文件和输出文件
1>Checking Build System
1>CMake does not need to re-run because D:/RabbitMQ/C_Client/test/build/rabbitmq-c-me/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because D:/RabbitMQ/C_Client/test/build/rabbitmq-c-me/librabbitmq/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because D:/RabbitMQ/C_Client/test/build/rabbitmq-c-me/examples/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because D:/RabbitMQ/C_Client/test/build/rabbitmq-c-me/tests/CMakeFiles/generate.stamp is up-to-date.
1>生成日志保存在“file://d:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\ZERO_CHECK.dir\Debug\BuildLog.htm”
1>ZERO_CHECK - 0 个错误,0 个警告
2>------ 已启动全部重新生成: 项目: rabbitmq, 配置: Debug Win32 ------
2>正在删除项目“rabbitmq”(配置“Debug|Win32”)的中间文件和输出文件
2>Generating amqp_codegen.py
2>Generating codegen.py
2>Generating amqp_framing.c
2>Generating amqp_framing.h
2>Building Custom Rule D:/RabbitMQ/C_Client/test/rabbitmq-c-master/librabbitmq/CMakeLists.txt
2>CMake does not need to re-run because D:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\librabbitmq\CMakeFiles\generate.stamp is up-to-date.
2>正在编译...
2>socket.c
2>..\..\..\rabbitmq-c-master\librabbitmq\win32\socket.c(71) : warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details.
2>        d:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(207) : 参见“strdup”的声明
2>..\..\..\rabbitmq-c-master\librabbitmq\win32\socket.c(73) : warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details.
2>        d:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(207) : 参见“strdup”的声明
2>amqp_url.c
2>..\..\..\rabbitmq-c-master\librabbitmq\amqp_url.c(84) : warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2>        d:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(324) : 参见“sscanf”的声明
2>amqp_table.c
2>amqp_socket.c
2>..\..\..\rabbitmq-c-master\librabbitmq\amqp_socket.c(64) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2>        d:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : 参见“sprintf”的声明
2>amqp_mem.c
2>amqp_connection.c
2>amqp_api.c
2>..\..\..\rabbitmq-c-master\librabbitmq\amqp_api.c(77) : warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details.
2>        d:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(207) : 参见“strdup”的声明
2>..\..\..\rabbitmq-c-master\librabbitmq\amqp_api.c(176) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2>        d:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : 参见“sprintf”的声明
2>..\..\..\rabbitmq-c-master\librabbitmq\amqp_api.c(193) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2>        d:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : 参见“sprintf”的声明
2>amqp_framing.c
2>正在生成代码...
2>正在编译资源清单...
2>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
2>Copyright (C) Microsoft Corporation.  All rights reserved.
2>正在链接...
2>LINK : 没有找到 D:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\librabbitmq\Debug\rabbitmq.1.dll 或上一个增量链接没有生成它;正在执行完全链接
2>   正在创建库 D:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\librabbitmq\Debug\rabbitmq.1.lib 和对象 D:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\librabbitmq\Debug\rabbitmq.1.exp
2>正在嵌入清单...
2>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
2>Copyright (C) Microsoft Corporation.  All rights reserved.
2>生成日志保存在“file://d:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\librabbitmq\rabbitmq.dir\Debug\BuildLog.htm”
2>rabbitmq - 0 个错误,7 个警告
3>------ 已启动全部重新生成: 项目: test_parse_url, 配置: Debug Win32 ------
4>------ 已启动全部重新生成: 项目: amqp_unbind, 配置: Debug Win32 ------
4>正在删除项目“amqp_unbind”(配置“Debug|Win32”)的中间文件和输出文件
3>正在删除项目“test_parse_url”(配置“Debug|Win32”)的中间文件和输出文件
3>Building Custom Rule D:/RabbitMQ/C_Client/test/rabbitmq-c-master/tests/CMakeLists.txt
4>Building Custom Rule D:/RabbitMQ/C_Client/test/rabbitmq-c-master/examples/CMakeLists.txt
4>CMake does not need to re-run because D:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\CMakeFiles\generate.stamp is up-to-date.
3>CMake does not need to re-run because D:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\tests\CMakeFiles\generate.stamp is up-to-date.
3>正在编译...
4>正在编译...
3>test_parse_url.c
4>platform_utils.c
3>..\..\..\rabbitmq-c-master\tests\test_parse_url.c(68) : warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details.
3>        d:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(207) : 参见“strdup”的声明
3>..\..\..\rabbitmq-c-master\tests\test_parse_url.c(92) : warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details.
3>        d:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(207) : 参见“strdup”的声明
4>utils.c
4>amqp_unbind.c
4>正在生成代码...
3>正在编译资源清单...
4>正在编译资源清单...
3>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
3>Copyright (C) Microsoft Corporation.  All rights reserved.
4>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
4>Copyright (C) Microsoft Corporation.  All rights reserved.
3>正在链接...
4>正在链接...
3>正在嵌入清单...
4>正在嵌入清单...
4>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
4>Copyright (C) Microsoft Corporation.  All rights reserved.
3>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
3>Copyright (C) Microsoft Corporation.  All rights reserved.
3>生成日志保存在“file://d:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\tests\test_parse_url.dir\Debug\BuildLog.htm”
3>test_parse_url - 0 个错误,2 个警告
4>生成日志保存在“file://d:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\amqp_unbind.dir\Debug\BuildLog.htm”
4>amqp_unbind - 0 个错误,0 个警告
5>------ 已启动全部重新生成: 项目: amqp_sendstring, 配置: Debug Win32 ------
5>正在删除项目“amqp_sendstring”(配置“Debug|Win32”)的中间文件和输出文件
5>Building Custom Rule D:/RabbitMQ/C_Client/test/rabbitmq-c-master/examples/CMakeLists.txt
5>CMake does not need to re-run because D:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\CMakeFiles\generate.stamp is up-to-date.
5>正在编译...
5>platform_utils.c
6>------ 已启动全部重新生成: 项目: amqp_rpc_sendstring_client, 配置: Debug Win32 ------
6>正在删除项目“amqp_rpc_sendstring_client”(配置“Debug|Win32”)的中间文件和输出文件
6>Building Custom Rule D:/RabbitMQ/C_Client/test/rabbitmq-c-master/examples/CMakeLists.txt
6>CMake does not need to re-run because D:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\CMakeFiles\generate.stamp is up-to-date.
6>正在编译...
6>platform_utils.c
5>utils.c
5>amqp_sendstring.c
5>正在生成代码...
5>正在编译资源清单...
6>utils.c
5>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
5>Copyright (C) Microsoft Corporation.  All rights reserved.
5>正在链接...
6>amqp_rpc_sendstring_client.c
6>..\..\..\rabbitmq-c-master\examples\amqp_rpc_sendstring_client.c(186) : warning C4244: “=”: 从“uint64_t”转换到“size_t”,可能丢失数据
6>正在生成代码...
6>正在编译资源清单...
5>正在嵌入清单...
6>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
6>Copyright (C) Microsoft Corporation.  All rights reserved.
6>正在链接...
5>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
5>Copyright (C) Microsoft Corporation.  All rights reserved.
6>正在嵌入清单...
6>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
6>Copyright (C) Microsoft Corporation.  All rights reserved.
5>生成日志保存在“file://d:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\amqp_sendstring.dir\Debug\BuildLog.htm”
5>amqp_sendstring - 0 个错误,0 个警告
6>生成日志保存在“file://d:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\amqp_rpc_sendstring_client.dir\Debug\BuildLog.htm”
6>amqp_rpc_sendstring_client - 0 个错误,1 个警告
7>------ 已启动全部重新生成: 项目: amqp_producer, 配置: Debug Win32 ------
7>正在删除项目“amqp_producer”(配置“Debug|Win32”)的中间文件和输出文件
7>Building Custom Rule D:/RabbitMQ/C_Client/test/rabbitmq-c-master/examples/CMakeLists.txt
7>CMake does not need to re-run because D:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\CMakeFiles\generate.stamp is up-to-date.
7>正在编译...
7>platform_utils.c
8>------ 已启动全部重新生成: 项目: amqp_listenq, 配置: Debug Win32 ------
8>正在删除项目“amqp_listenq”(配置“Debug|Win32”)的中间文件和输出文件
8>Building Custom Rule D:/RabbitMQ/C_Client/test/rabbitmq-c-master/examples/CMakeLists.txt
8>CMake does not need to re-run because D:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\CMakeFiles\generate.stamp is up-to-date.
8>正在编译...
8>platform_utils.c
7>utils.c
7>amqp_producer.c
7>..\..\..\rabbitmq-c-master\examples\amqp_producer.c(99) : warning C4244: “初始化”: 从“uint64_t”转换到“int”,可能丢失数据
7>正在生成代码...
8>utils.c
7>正在编译资源清单...
7>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
7>Copyright (C) Microsoft Corporation.  All rights reserved.
7>正在链接...
8>amqp_listenq.c
8>..\..\..\rabbitmq-c-master\examples\amqp_listenq.c(119) : warning C4244: “=”: 从“uint64_t”转换到“size_t”,可能丢失数据
8>正在生成代码...
8>正在编译资源清单...
8>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
8>Copyright (C) Microsoft Corporation.  All rights reserved.
8>正在链接...
7>正在嵌入清单...
7>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
7>Copyright (C) Microsoft Corporation.  All rights reserved.
8>正在嵌入清单...
7>生成日志保存在“file://d:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\amqp_producer.dir\Debug\BuildLog.htm”
7>amqp_producer - 0 个错误,1 个警告
8>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
8>Copyright (C) Microsoft Corporation.  All rights reserved.
8>生成日志保存在“file://d:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\amqp_listenq.dir\Debug\BuildLog.htm”
8>amqp_listenq - 0 个错误,1 个警告
9>------ 已启动全部重新生成: 项目: amqp_listen, 配置: Debug Win32 ------
9>正在删除项目“amqp_listen”(配置“Debug|Win32”)的中间文件和输出文件
9>Building Custom Rule D:/RabbitMQ/C_Client/test/rabbitmq-c-master/examples/CMakeLists.txt
9>CMake does not need to re-run because D:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\CMakeFiles\generate.stamp is up-to-date.
9>正在编译...
9>platform_utils.c
10>------ 已启动全部重新生成: 项目: amqp_exchange_declare, 配置: Debug Win32 ------
10>正在删除项目“amqp_exchange_declare”(配置“Debug|Win32”)的中间文件和输出文件
10>Building Custom Rule D:/RabbitMQ/C_Client/test/rabbitmq-c-master/examples/CMakeLists.txt
10>CMake does not need to re-run because D:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\CMakeFiles\generate.stamp is up-to-date.
9>utils.c
10>正在编译...
9>amqp_listen.c
10>platform_utils.c
9>..\..\..\rabbitmq-c-master\examples\amqp_listen.c(138) : warning C4244: “=”: 从“uint64_t”转换到“size_t”,可能丢失数据
9>正在生成代码...
9>正在编译资源清单...
9>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
9>Copyright (C) Microsoft Corporation.  All rights reserved.
9>正在链接...
9>正在嵌入清单...
10>utils.c
9>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
9>Copyright (C) Microsoft Corporation.  All rights reserved.
10>amqp_exchange_declare.c
10>正在生成代码...
9>生成日志保存在“file://d:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\amqp_listen.dir\Debug\BuildLog.htm”
9>amqp_listen - 0 个错误,1 个警告
11>------ 已启动全部重新生成: 项目: amqp_consumer, 配置: Debug Win32 ------
11>正在删除项目“amqp_consumer”(配置“Debug|Win32”)的中间文件和输出文件
10>正在编译资源清单...
11>Building Custom Rule D:/RabbitMQ/C_Client/test/rabbitmq-c-master/examples/CMakeLists.txt
10>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
10>Copyright (C) Microsoft Corporation.  All rights reserved.
10>正在链接...
11>CMake does not need to re-run because D:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\CMakeFiles\generate.stamp is up-to-date.
11>正在编译...
11>platform_utils.c
10>正在嵌入清单...
10>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
10>Copyright (C) Microsoft Corporation.  All rights reserved.
10>生成日志保存在“file://d:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\amqp_exchange_declare.dir\Debug\BuildLog.htm”
10>amqp_exchange_declare - 0 个错误,0 个警告
11>utils.c
12>------ 已启动全部重新生成: 项目: amqp_bind, 配置: Debug Win32 ------
12>正在删除项目“amqp_bind”(配置“Debug|Win32”)的中间文件和输出文件
12>Building Custom Rule D:/RabbitMQ/C_Client/test/rabbitmq-c-master/examples/CMakeLists.txt
11>amqp_consumer.c
12>CMake does not need to re-run because D:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\CMakeFiles\generate.stamp is up-to-date.
12>正在编译...
11>..\..\..\rabbitmq-c-master\examples\amqp_consumer.c(95) : warning C4244: “=”: 从“uint64_t”转换到“size_t”,可能丢失数据
11>正在生成代码...
11>正在编译资源清单...
12>platform_utils.c
11>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
11>Copyright (C) Microsoft Corporation.  All rights reserved.
11>正在链接...
11>正在嵌入清单...
11>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
11>Copyright (C) Microsoft Corporation.  All rights reserved.
12>utils.c
12>amqp_bind.c
11>生成日志保存在“file://d:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\amqp_consumer.dir\Debug\BuildLog.htm”
11>amqp_consumer - 0 个错误,1 个警告
13>------ 已启动全部重新生成: 项目: test_tables, 配置: Debug Win32 ------
13>正在删除项目“test_tables”(配置“Debug|Win32”)的中间文件和输出文件
13>Building Custom Rule D:/RabbitMQ/C_Client/test/rabbitmq-c-master/tests/CMakeLists.txt
12>正在生成代码...
12>正在编译资源清单...
13>CMake does not need to re-run because D:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\tests\CMakeFiles\generate.stamp is up-to-date.
13>正在编译...
12>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
12>Copyright (C) Microsoft Corporation.  All rights reserved.
12>正在链接...
13>test_tables.c
13>..\..\..\rabbitmq-c-master\tests\test_tables.c(335) : warning C4305: “=”: 从“double”到“float”截断
13>..\..\..\rabbitmq-c-master\tests\test_tables.c(436) : warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
13>        d:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(447) : 参见“getenv”的声明
13>..\..\..\rabbitmq-c-master\tests\test_tables.c(440) : warning C4996: 'tmpfile': This function or variable may be unsafe. Consider using tmpfile_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
13>        d:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(334) : 参见“tmpfile”的声明
12>正在嵌入清单...
13>..\..\..\rabbitmq-c-master\tests\test_tables.c(442) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
13>        d:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(126) : 参见“strerror”的声明
13>..\..\..\rabbitmq-c-master\tests\test_tables.c(452) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
13>        d:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : 参见“sprintf”的声明
13>..\..\..\rabbitmq-c-master\tests\test_tables.c(453) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
13>        d:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : 参见“fopen”的声明
13>..\..\..\rabbitmq-c-master\tests\test_tables.c(455) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
13>        d:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(126) : 参见“strerror”的声明
13>正在编译资源清单...
13>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
13>Copyright (C) Microsoft Corporation.  All rights reserved.
13>正在链接...
12>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
12>Copyright (C) Microsoft Corporation.  All rights reserved.
13>正在嵌入清单...
12>生成日志保存在“file://d:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\examples\amqp_bind.dir\Debug\BuildLog.htm”
12>amqp_bind - 0 个错误,0 个警告
13>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
13>Copyright (C) Microsoft Corporation.  All rights reserved.
13>生成日志保存在“file://d:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\tests\test_tables.dir\Debug\BuildLog.htm”
13>test_tables - 0 个错误,7 个警告
14>------ 已启动全部重新生成: 项目: ALL_BUILD, 配置: Debug Win32 ------
14>正在删除项目“ALL_BUILD”(配置“Debug|Win32”)的中间文件和输出文件
14>Building Custom Rule D:/RabbitMQ/C_Client/test/rabbitmq-c-master/CMakeLists.txt
14>CMake does not need to re-run because D:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\CMakeFiles\generate.stamp is up-to-date.
14>生成日志保存在“file://d:\RabbitMQ\C_Client\test\build\rabbitmq-c-me\ALL_BUILD.dir\Debug\BuildLog.htm”
14>ALL_BUILD - 0 个错误,0 个警告
========== 全部重新生成: 成功 14 个,失败 0 个,跳过 0 个 ==========

至此,可以按照 https://github.com/alanxz/rabbitmq-c 上的说明,执行测试了:

Running the examples
Arrange for a RabbitMQ or other AMQP server to be running on localhost at TCP port number 5672.

In one terminal, run
./examples/amqp_listen localhost 5672 amq.direct test
In another terminal,
./examples/amqp_sendstring localhost 5672 amq.direct test "hello world"

You should see output similar to the following in the listener's terminal window:

Result 1
Frame type 1, channel 1
Method AMQP_BASIC_DELIVER_METHOD
Delivery 1, exchange amq.direct routingkey test
Content-type: text/plain
----
00000000: 68 65 6C 6C 6F 20 77 6F : 72 6C 64                 hello world
0000000B:

你可能感兴趣的:(【原创】如何正确生成RabbitMQ-C客户端库)