因为项目原因,需要使用到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)的更多相关文章

  1. 【转】Windows下使用VS2008编译OpenCV 2.1 添加Intel TBB和Python支持

    Windows下使用VS2008编译OpenCV2.1 添加Intel TBB和Python支持 步骤: 1.仔细阅读OpenCV官网上的InstallGuide:http://opencv.will ...

  2. 实践详细篇-Windows下使用VS2015编译的Caffe训练mnist数据集

    上一篇记录的是学习caffe前的环境准备以及如何创建好自己需要的caffe版本.这一篇记录的是如何使用编译好的caffe做训练mnist数据集,步骤编号延用上一篇 <实践详细篇-Windows下 ...

  3. windows下用vs2010编译ffmpeg

    转载自;http://q1q2q3q4q5q6ln.blog.163.com/blog/static/500794332014666536283/ (注意:请务必先阅读:七,后记补充:) ffmpeg ...

  4. Windows下从源代码编译Skia

    在PPAPI里面画图,能够结合第三方的图形库.比方Cairo.Skia. Google Chrome.Chromium和Android都使用Skia作为画图引擎.我也来试试Skia,先过编译关. fo ...

  5. Windows 下使用 GNUstep 编译并运行 Objective-C 程序

    今晚上开始看<Objective-C 程序设计(第4版)>这本书(OSChina 正在做此书的书评活动,详情请看这里),到现在为止看到第 7 章,于是想动手试试写两简单的程序编译跑跑看. ...

  6. 在windows下使用vs2013编译和调试mysql源代码

    1. 准备工作 1)OS:win10 + VS2013 2)mysql 源码(windows版):mysql-5.6.25.zip 3)perl tool:ActivePerl-5.16.3.1604 ...

  7. Windows下RabbitMQ安装,部署,配置

    安装部署 1.当前环境以及参考资料出处 部署环境:windows server 2008 r2 enterprise 官方安装部署文档:http://www.rabbitmq.com/install- ...

  8. 在Windows下利用php自带的mail函数发邮件

    这几天看<Head First PHP & MySQL>,里面有发邮件的例子是用系统自带的mail函数发送的,自己照书上写的试了一直不成功,后来终于在网上找到解决方案,现在总结下. ...

  9. 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 ...

  10. Windows下RabbitMQ安装及入门

    1.Windows下安装RabbitMQ需要以下几个步骤 (1):下载erlang,原因在于RabbitMQ服务端代码是使用并发式语言erlang编写的,下载地址:http://www.erlang. ...

随机推荐

  1. 关于RTSP-Over-HTTP

    --------------------更新2018.07.10------------------- myRtspClient-1.3.0开始支持RTSP-Over-HTTP ----------- ...

  2. 图像中的stride含义

    这个不是卷积中的步长stride 是另外一个含义, stride = 每个像素所占字节数 * width input stride为我们正常进行卷积时候设置的stride值,output stride ...

  3. 3.十分钟搞定Vue搭建

    Vue推荐开发环境 Node.js 6.2.0.npm 3.8.9.webpack 1.13.vue-cli 2.5.1.webstrom2016 现在开始安装环境 安装nodejs 可以在终端里下载 ...

  4. Springboot整合Mybatis 之分页插件使用

    1: 引入jar包 <!-- 引入MyBatis分页插件--> <dependency> <groupId>com.github.pagehelper</gr ...

  5. CentOS上svn checkout时报错SSL handshake failed: SSL error: Key usage violation in certificate has been det

    局域网安装了个SVN在checkout的时候报错 SSL handshake failed: SSL error: Key usage violation in certificate has bee ...

  6. VM虚拟机配置固定IP

    linux下vmware桥接模式.静态ip上外网的配置 http://blog.csdn.net/zdh_139/article/details/73456654 虚拟机网络改成桥接模式 vi /et ...

  7. NSOperation、NSOperationQueue(III)

    NSOperation.NSOperationQueue 常用属性和方法归纳 NSOperation 常用属性和方法 a. 取消操作方法 //可取消操作,实质是标记 isCancelled 状态. - ...

  8. SLAM学习笔记 - 视觉SLAM方法资源汇总

    工具类: ros框架 linux系列教程     vim Eigen     Eigen快速入门 Pangolin  Pangolin安装与使用 数据集: TUM         数据格式 提供pyt ...

  9. 【转】Tomcat 快速入门

    本文转载自:https://www.cnblogs.com/jingmoxukong/p/8258837.html?utm_source=gold_browser_extension 目录 Tomca ...

  10. flask 在视图函数中验证表单

    在视图函数中验证表单 因为现在的basic_form视图同时接受两种类型的请求:GET请求和POST请求.所以我们要根据请求方法的不同执行不同的代码.具体来说,首先是实例化表单,如果是GET请求,就渲 ...