activemq-cpp 例子编译

AI权益加码!Claude Code、Cursor等20+工具免费用! 购周边限时加赠Coding Plan Lite,畅享主流AI工具!学习进阶更高效! 阅读详情

编译:

在linux编译直接使用命令编译例子程序。

g++ -o main -pthread -I ../main main.cpp -I /usr/local/apr/include/apr-1/ /usr/local/lib/libactivemq-cpp.a /usr/local/apr/lib/libapr-1.a


转载官网


Dependencies

libuuid

The build requires the libuuid library that is part of the e2fsprogs package and is available from http://e2fsprogs.sourceforge.net/ which is not always installed by default.

cppunit

The package contains a complete set of cppunit tests. In order for you to build an run the tests, you will need to download and install the cppunit suite. Seehttp://cppunit.sourceforge.net/cppunit-wiki

or on Fedora type the following:

sudo yum install cppunit

Make sure that the paths to the installed cppunit library and includes are visible in your current shell before you try building the tests.

Windows users will need to build the cppunit library using the CPPUnit MSVC project files.  A discussion of the build process can be found on the CPPUnit wiki under CPPUnit Platform build instructions this covers both MSVC along with many other platforms and tool suites.

GNU Build System (for building on *nix)

To Generate the ./configure script use to create the Makefiles, you need the following software installed:

Tool

Recommended Version

autoconf

>= 2.59 

automake

>= 1.9.6

libtool

>= 1.5.22 

Building on *nix (Unix/Linux/OS X/Cygwin)

This assumes you have all of the project dependencies installed. We're now ready to create the configure script. To do this, run:

./autogen.sh

You may see the following warnings when running this command:

src/test-integration/Makefile.am:44: `CXXFLAGS' is a user variable, you should not override it;
src/test-integration/Makefile.am:44: use `AM_CXXFLAGS' instead.
src/test/Makefile.am:104: `CXXFLAGS' is a user variable, you should not override it;
src/test/Makefile.am:104: use `AM_CXXFLAGS' instead.

These can be ignored. We override CXXFLAGS in the makefiles for the unit and integration tests in order to suppress compiler warnings.

This should be run the first time and anytime you change configure.ac or any of the Makefile.am files.

Solaris 10 Note

CPP_UNIT might not build until you correct the file libstdc++.la to contain the correct data, see this discussion.

http://forum.sun.com/jive/thread.jspa?threadID=73150

The configure script will customize the way the software is built and installed into your system along with detecting the available libraries that have been installed. To use the default configuration just run:

./configure

For more help on how to customize the build configuration, run:

./configure --help

Once the configure script has run successfully, you are ready to build. Run:

make

This will build all of the core ActiveMQ CPP source code. To build and install the code into the system directories, run:

make install

You will have to become the superuser in order to be able to install the files.

Doxygen

To generate the doxygen documentation for the project, just run:

make doxygen-run

Running Tests

Unit Tests

In order to build and run the suite of unit tests, run:

make check

This will verify that the library is functioning correctly on the target platform. In addition, it will generate the integration tests binary.

Integration Tests

The library also contains a set of tests that are run against a real AMQ broker. These allow you to validate this distribution of ActiveMQ CPP against your broker. Running these without a broker will result in failed tests. The tests currently hard-code the broker url to be tcp://localhost:61613 for stomp and tcp://localhost:61616 for openwire.

The integration tests are built via "make check". To run them, first start a broker and then

cd src/test-integration
./activemq-test-integration

This will take quite some time to complete, so be patient.

Example

There is an example application that ships with the distribution in src/examples. The example is compiled by default with the "make" command, but can easily be compiled manually using the command:

g++ -o main -pthread -I ../main main.cpp ../../out/libactivemq-cpp-0_0_2.a -luuid

Notes for Windows users

We support using the GNU compiler on Windows, using the Cygwin package. However we also support using the MSVC compiler on Windows.

There are a couple or things that you will need to setup to ensure that the MSVC compile succeeds.

  • You need to download and install the Platform SDK if you don't have it installed already.
  • Ensure that the path to you MSVC install is set in the PATH env variable. You can test this by typing cl.exe at the command line, if you get an error complaining that its not found, then you'll need to fix your PATH.
  • Set the INCLUDE env variable to include the path to your MSVC includes, and the platform SDK includes. For example:
    INCLUDE = D:\Program Files\Microsoft Visual Studio 8 \VC\include;D:\Program Files\Microsoft Platform SDK\Include\*
  • Set the LIB env variable to include the path to your MSVC libs, and the Platform SDK libs. For example:
    LIB = D:\Program Files\Microsoft Visual Studio 8 \VC\lib;D:\Program Files\Microsoft Platform SDK\Lib
  • The Project files reference the CPPUnit libraries for the Integration and Unit tests builds.  In order for these to build correctly you must either place the CPPUnit libraries in a directory listed in the project settings, or add a new location for your install of CPPUnit. 

ActiveMQActiveMQ-CPP 一天功夫终于知道怎么使用activeMQ的c++接口了。 花费时间最多的是不知道activemqcpp需要在activeMQ的基础上使用。 下面分别讲述activeMQactivemqcpp的安装和使用。 一。 ActiveMQ的安装       1. 下载 源包: http://activemq.apache.org/download-archives.html        阅读详情

相关推荐

Linux下安装ActiveMQ CPP

ActiveMQ CPPActiveMQ CPP是用C++语言访问ActiveMQ的客户端开发库,也称cms(cpp message service),安装cms开发库需要先安装一些基础库。(1)cppunit打开http://activemq.apache.org/cms/building.html页面,这里介绍了cms build时用到的依赖库。 cppunit下载页面: https://s

猫哥 5340

编译好的activemq-cpp动态库(2.2.6版本+vs2010)

自己编译activemq-cpp的2.X的最后版本,在windows + vs2010下测试通过。压缩包中包含了include\lib\dll文件。 由于尝试了N个3.X的版本都不同过,于是退到2.X版本,通过了,另外在vs2005下编译出来的也没有问题。 【版本说明】 ActiveMQ-cpp: 2.2.6, http://activemq.apache.org/cms APR/APR-UTIL: 1.5.1, http://apr.apache.org ---------------------------------------------------- ActiveMQ-cpp-2.2.6 svn: https://svn.apache.org/repos/asf/activemq/activemq-cpp/tags/activemq-cpp-2.2.6 ---------------------------------------------------- Compile Env: WinXP + VS2010 + Win32 Example Test Env: Ubuntu + Apollo 1.7 (stompy on port 61613)

activemq-cpp发送接收消息,消息过滤器

本代码关于activemq-cpp的核心代码参考的chenxun2009的博客园,其他部分包括:从配置文件中读取消息通道,过滤条件等信息。

ActiveMQ-CPP编译

ActiveMQ CPP C++

bodybo的专栏 1万+

Mqtt开发笔记:Mqtt服务器搭建

使用到mqtt服务器(中间件)。

长沙红胖子 Qt・西安|省级科研团队从业背景,深耕双一流体系高精尖技术配套研发|剥离高精尖机理,沉淀高端特种行业领域 Qt 工程化落地经验|博文仅分享通用技术总结,输出公开普适工程思路。 6万+

activeMq-CPP使用

activeMq-CPP应用程序demo author: 陈训 一、avtiveMq服务端的安装 1、从官网获取软件包: 网址:http://activemq.apache.org/activemq-590-release.html 2、解压运行activeMq wget   http://archive.apache.org/dist/activemq/apache-active

chen 1万+

探索ActiveMQ CPP库:高效消息传递的利器

探索ActiveMQ CPP库:高效消息传递的利器 项目介绍 ActiveMQ CPP库是一个多功能的消息传递库,支持多种协议与消息中间件(如ActiveMQ)进行通信。无论是在Unix类型的系统还是Windows平台上,ActiveMQ CPP都提供了强大的功能和灵活的配置选项,使得开发者能够轻松实现高效的消息传递机制。 项目技术分析 ActiveMQ CPP库的构建依赖于多个关键技术组件,包括...

gitblog_00542的博客 1072

ActiveMQ-CPP在linux环境下的编译

linux c++ ActiveMQ CPP ActiveMQ-CPP

bodybo的专栏 6569

ActiveMQ进行C++与C#的通信3 - 编译ActiveMQ-CPP

本文主要介绍了在Windows环境下使用VS2012编译ActiveMQ-CPP的过程,包含了CppUnit、APR等编译过程,并对在编译时可能会遇到的问题进行分析解决。

pigautumn的专栏 1974

linux activemq-cpp编译

仅作为编译记录http://blog.csdn.net/lgh1700/article/details/51055784http://activemq.apache.org/cms/building.html依赖库versioncppunit-1.14.0.tar.gzapr-1.6.2.tar.gzapr-util-1.6.0.tar.gzapr-iconv-1.2.1.tar.gze2fspro

zim3oo的博客 1180

activemq-cpp开发手册

activemq-cpp开发手册,doc版,测试可用与最新的接口。

ActiveMQ C++ Windows客户端 3.8.3例子代码(含头文件和编译出来的dll和lib)

activemq的最新的CMS客户端代码是3.8.3,由于在windows下编译比较麻烦,遍寻网络不获,所以自己仔细研究了一下,终于编译成功,分享给大家。附件中的例子工程在vs2010下编译通过。如果需要移植到自己的工程里,仅需要把include和lib两个目录复制到自己的工程下,然后进行相应配置即可。ps:需要在自己的工程里把那几个lib文件配置到链接——输入里(大概有六七个就行了,具体可参考网上其他朋友的文档)。对了,本例子只是制作了release版本,debug没做,所以,debug的不能run哦。如果有自己想改cms源码的话,我想,那些大拿自己编译出来是没有问题的,也就不需要参考偶的拙劣之作了 顺祝大家工作顺利!

AcTiveMQ-cpp3.7.0我自己用VS2008编译好的头文件与库文件

Activemq-cpp是一个与ActiveMQ交互通讯的C++ API开发库,为C++开发者提供了一个访问ActiveMQ的接口。 我自己用VS2008编译好的AcTiveMQ-cpp3.7.0的头文件与库文件,可以直接集成到开发环境中使用,省去了自己编译的麻烦。

activemq-cpp-library在VS2015下的编译

从http://activemq.apache.org/cms/download.html下载最新版本的activemq-cpp,解压后,可以看到有一个vs2010-build文件夹,打开里面的activemq-cpp.sln。阅读README.txt文档,根据提示,下载依赖库 APR:http://apr.apache.org/ CPPUnit:http://cppunit.sourceforge

zuolj的专栏 5626

ActiveMQ-CPP在LINUX环境下的编译

(1) 编译安装cppunit-1.12.1 ,切换至该目录。执行./configure --prefix=/usr/local/cppunit/ ,执行make,再执行make install 进行安装。这时可以到/usr/local下查看会生成cppunit目录。         在linux能正常编译,但在solaris下make时遇到点问题,报错:         ../../incl

lenny0519nzz的专栏 2415

ActiveMQ-Cpp vs2015编译

编译所需资源: https://download.csdn.net/download/ct6816678/11990145 APR库需要用到三个:apr、apr-iconv、apr-util,下载解压后把文件夹的版本号去掉。 Activemq-cpp-library编译 首先需要编译的是activemq-cpp这个项目,编译前工作:把头文件目录以及附加库目录设置好,在属性-》C/C+...

ct6816678的专栏 510

编译ActiveMQ-CPP库遇到的那点事

编译ActiveMQ-CPP库遇到的那点事 工作需要,需要编译ActiveMQ-cpp库,现将编译过程中遇到的问题及解决办法记录下来,以供他人参考,少走弯路。 ActiveMQ-CPP从2.2版本以后依赖Apache Portable Runtime项目,所以在编译之前需要先编译apr库。 从Apache Portable Runtime项目官网上下载最新的APR源代码,截至目前,最新的APR版本...

初心只为你 1384

Windows编译ActiveMQ-cpp-Library

编译环境、编译工具: win10系统 Visual Studio 2017(需要安装windows SDK 8.1组件) cmake 3.18 准备组件: 1.OpenSSL 1.0.2u 可以自己编译,也可以下载第三方编译好的 我使用的是第三方OpenSSL下载地址:http://slproweb.com/products/Win32OpenSSL.html 2.apr-1.7.0、apr-util-1.6.1、apr-iconv-1.2.2(下载地址:https://..

shihoongbo的博客 1229
上一篇: python的类属性和实例属性
下一篇: gdb 安装
studyforir
博客等级 码龄12年 3粉丝 1原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值