windows下rabbitmq-c编译(带openssl、无需MinGW)
因为项目原因,需要使用到rabbitmq的c客户端库。首先,参见上一篇windows下openssl编译,如果已经使用cmake编译过了,则先delete cache(File-Delete Cache),否则原来的cmake缓存都在了,将仍然会出现原来的错误。

依次点击configire、generate,可以生成vs sln。如下:

最后使用VS即可生成rabbitmq.4.dll,如下:

测试自带的例子:
D:\RabbitMQ Server\rabbitmq_server-3.6.5\sbin>cd /d D:\rabbitmq-c-0.8.0-build\examples\Debug D:\rabbitmq-c-0.8.0-build\examples\Debug>amqp_listen localhost 5672 amq.direct test
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:
Delivery 2, exchange amq.direct routingkey test
Content-type: text/plain
----
00000000: 68 65 6C 6C 6F 20 77 6F : 72 6C 64 hello world
0000000B:
Delivery 3, exchange amq.direct routingkey test
Content-type: text/plain
----
00000000: 68 65 6C 6C 6F 20 77 6F : 72 6C 64 hello world
0000000B:
Delivery 4, exchange amq.direct routingkey test
新开一个窗口,执行如下:
D:\RabbitMQ Server\rabbitmq_server-3.6.5\sbin>cd /d D:\rabbitmq-c-0.8.0-build\examples\Debug D:\rabbitmq-c-0.8.0-build\examples\Debug>amqp_sendstring localhost 5672 amq.direct test "hello world" D:\rabbitmq-c-0.8.0-build\examples\Debug>amqp_sendstring localhost 5672 amq.direct test "hello world" D:\rabbitmq-c-0.8.0-build\examples\Debug>amqp_sendstring localhost 5672 amq.direct test "hello world" D:\rabbitmq-c-0.8.0-build\examples\Debug>amqp_sendstring localhost 5672 amq.direct test "hello world" D:\rabbitmq-c-0.8.0-build\examples\Debug>amqp_sendstring localhost 5672 amq.direct test "hello world" D:\rabbitmq-c-0.8.0-build\examples\Debug>amqp_sendstring localhost 5672 amq.direct test "hello world" D:\rabbitmq-c-0.8.0-build\examples\Debug>amqp_sendstring localhost 5672 amq.direct test "hello world"
需要注意的是,librabbitmq的channel不是线程安全的,因此需要应用自行保证线程安全性,如下所述:
Threading
You cannot share a socket, an amqp_connection_state_t, or a channel between threads using librabbitmq. The librabbitmqlibrary is built with event-driven, single-threaded applications in mind, and does not yet cater to any of the requirements of pthreaded applications.
Your applications instead should open an AMQP connection (and an associated socket, of course) per thread. If your program needs to access an AMQP connection or any of its channels from more than one thread, it is entirely responsible for designing and implementing an appropriate locking scheme. It will generally be much simpler to have a connection exclusive to each thread that needs AMQP service.
官方主页https://github.com/alanxz/rabbitmq-c
doc api http://alanxz.github.io/rabbitmq-c/docs/0.8.0/classes.html
剩下的就是慢慢啃主要的api了。
windows下rabbitmq-c编译(带openssl、无需MinGW)的更多相关文章
- 【转】Windows下使用VS2008编译OpenCV 2.1 添加Intel TBB和Python支持
Windows下使用VS2008编译OpenCV2.1 添加Intel TBB和Python支持 步骤: 1.仔细阅读OpenCV官网上的InstallGuide:http://opencv.will ...
- 实践详细篇-Windows下使用VS2015编译的Caffe训练mnist数据集
上一篇记录的是学习caffe前的环境准备以及如何创建好自己需要的caffe版本.这一篇记录的是如何使用编译好的caffe做训练mnist数据集,步骤编号延用上一篇 <实践详细篇-Windows下 ...
- windows下用vs2010编译ffmpeg
转载自;http://q1q2q3q4q5q6ln.blog.163.com/blog/static/500794332014666536283/ (注意:请务必先阅读:七,后记补充:) ffmpeg ...
- Windows下从源代码编译Skia
在PPAPI里面画图,能够结合第三方的图形库.比方Cairo.Skia. Google Chrome.Chromium和Android都使用Skia作为画图引擎.我也来试试Skia,先过编译关. fo ...
- Windows 下使用 GNUstep 编译并运行 Objective-C 程序
今晚上开始看<Objective-C 程序设计(第4版)>这本书(OSChina 正在做此书的书评活动,详情请看这里),到现在为止看到第 7 章,于是想动手试试写两简单的程序编译跑跑看. ...
- 在windows下使用vs2013编译和调试mysql源代码
1. 准备工作 1)OS:win10 + VS2013 2)mysql 源码(windows版):mysql-5.6.25.zip 3)perl tool:ActivePerl-5.16.3.1604 ...
- Windows下RabbitMQ安装,部署,配置
安装部署 1.当前环境以及参考资料出处 部署环境:windows server 2008 r2 enterprise 官方安装部署文档:http://www.rabbitmq.com/install- ...
- 在Windows下利用php自带的mail函数发邮件
这几天看<Head First PHP & MySQL>,里面有发邮件的例子是用系统自带的mail函数发送的,自己照书上写的试了一直不成功,后来终于在网上找到解决方案,现在总结下. ...
- Win7 下用 VS2015 编译最新 openssl(1.0.2j)包含32、64位debug和release版本的dll、lib(8个版本)
Win7 64位系统下通过VS2015编译好的最新的OpenSSL(1.0.2j)所有八个版本的链接库, 包含以下八个版本: 1.32位.debug版LIB: 2.32位.release版LIB: 3 ...
- Windows下RabbitMQ安装及入门
1.Windows下安装RabbitMQ需要以下几个步骤 (1):下载erlang,原因在于RabbitMQ服务端代码是使用并发式语言erlang编写的,下载地址:http://www.erlang. ...
随机推荐
- js快速排序算法解析
数组的快速排序算法,和并归排序步骤基本类似. 都是先拆分,后合并.并归排序是:拆分容易,合并难. 快速排序是:拆分难,合并容易 要理解快速排序,首先要理解拆分逻辑 要素:找一个基准点,通过操作使得数列 ...
- SEO--简介
SEO:搜索引擎优化 不需付费 SEM:搜索引擎营销 需要付费 IP:每个家庭每个公司应该是同个IP PV:网站刷新搜索总量 UV:独立用户访客
- Koa中设置中文Cookie值
默认情况下, 如果 ctx.cookies.set('user', '杨过', { domain: 'xxxx', path: 'xxxx', maxAge: 24 * 60 * 60 * 1000, ...
- Lua class
local _class = {} function class(super) local class_type = {} class_type.ctor = false class_type.sup ...
- 关于toolchain(工具链)的一点知识
之前一直觉得toolchain是个高大上的东西,现摘录 uClibc中的FAQ以助理解. A toolchain consists of GNU binutils, the gcc compiler, ...
- java的移位运算详解(举例说明)
1)java中无符号右移:>>>,下面是一个int型的负数,然后每次移动一位. int k = -0x123;System.out.println(Integer.toBinaryS ...
- 水题 J
一张CT扫描的灰度图像可以用一个N*N(0 < N <= 100)的矩阵描述,矩阵上的每个点对应一个灰度值(整数),其取值范围是0-255.我们假设给定的图像中有且只有一个肿瘤.在图上监测 ...
- python:基于tkinter的定时关机程
本人使用python3 from tkinter import* import os from PIL import Image, ImageTk root=Tk() a=Label(root,tex ...
- Rpgmakermv(38)MOG_Theatrhythm
1.============================葡萄牙语=================================================+++ MOG - Theatrh ...
- Python -- Pandas介绍及简单实用【转】
转http://www.datadependence.com/2016/05/scientific-python-pandas/ 一. Pandas简介 1.Python Data Analysis ...