c++ client on windows. Need help to build.

1,176 views
Skip to first unread message

Nikita Black

unread,
Sep 5, 2014, 10:47:20 AM9/5/14
to rabbitm...@googlegroups.com
Greetings. I need a c++ client for windows. I'm a beginner and only yesterday I got to know about different make-tools. I've found several solutions:

amqpcpp - but it uses Makefile to build, so I can't build it on windows. Or can I?
AMQP-CPP - seems ok, but requires to handle connection "manually". For learning purposes I just want to use library that handles everything. So for now I'm not considering this lib.
SimpleAmqpClient - it have "simple" word in it's name so I started with it.

I downloaded CMake and successfully build librabbitmq with it. Although there was some warning in the end I have:
librabbitmq.1.lib - for static library
rabbitmq.1.dll and rabbitmq.1.lib - for dynamic library (but why *.lib, should I use it?)

Also I downloaded boost, build it.

Next I tried to run CMakeLists for SimpleAmpqClient but without success. It always terminates with errors. For example:

Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.

I tried tons of different paths, but none of them was accepted.  So what is correct values for for this variables?

Also there's an error:

Rabbitmqc_INCLUDE_DIR=Rabbitmqc_INCLUDE_DIR-NOTFOUND

Rabbitmqc_LIBRARY=Rabbitmqc_LIBRARY-NOTFOUND


Install the library (dev version) and try again. If the library is already
installed, use ccmake to set the missing variables manually.

How can I install the library? And what is values for this variables?

Thank you.

Nikita Black

unread,
Sep 5, 2014, 10:56:35 AM9/5/14
to rabbitm...@googlegroups.com
If I specify BOOST_ROOT (C:\boost_1_56_0) than I have an error:

Could not find the following Boost libraries:

boost_chrono
boost_system

No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.

I have this libraries. I specified a path to folder, but anyway always have this error.

пятница, 5 сентября 2014 г., 16:47:20 UTC+2 пользователь Nikita Black написал:

Alan Antonuk

unread,
Sep 6, 2014, 12:24:08 PM9/6/14
to Nikita Black, rabbitm...@googlegroups.com
On Fri, Sep 5, 2014 at 7:56 AM, Nikita Black <mynameisn...@gmail.com> wrote:
If I specify BOOST_ROOT (C:\boost_1_56_0) than I have an error:

Could not find the following Boost libraries:

boost_chrono
boost_system

No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.

I have this libraries. I specified a path to folder, but anyway always have this error.

The FindBoost.cmae module is a bit finicky to get to work sometimes. Depending on which version of CMake you have installed you may need to tell it about newer versions of Boost by adding the following flag (though if it found the headers you probably don't need this):
-DBoost_ADDITIONAL_VERSION="1.56.0" 

Also I believe that by default boost is built statically on Win32, if so you'll need to tell FindBoost.cmake to look for static libraries:
-DBoost_USE_STATIC_LIBS=ON

пятница, 5 сентября 2014 г., 16:47:20 UTC+2 пользователь Nikita Black написал:
Greetings. I need a c++ client for windows. I'm a beginner and only yesterday I got to know about different make-tools. I've found several solutions:

amqpcpp - but it uses Makefile to build, so I can't build it on windows. Or can I?
AMQP-CPP - seems ok, but requires to handle connection "manually". For learning purposes I just want to use library that handles everything. So for now I'm not considering this lib.
SimpleAmqpClient - it have "simple" word in it's name so I started with it.

I downloaded CMake and successfully build librabbitmq with it. Although there was some warning in the end I have:
librabbitmq.1.lib - for static library
rabbitmq.1.dll and rabbitmq.1.lib - for dynamic library (but why *.lib, should I use it?)

This is a Win32 thing: a simplistic description is: when you create a shared library you get two pieces: the *.dll which is loaded at runtime, and the *.lib which contains stubs that are linked at compile-time, which effectively point at the .dll file. You should link against the .lib file, and have the .dll file findable by the OS when you execute your program.

Also I downloaded boost, build it.

Next I tried to run CMakeLists for SimpleAmpqClient but without success. It always terminates with errors. For example:

Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.

I tried tons of different paths, but none of them was accepted.  So what is correct values for for this variables?

Also there's an error:

Rabbitmqc_INCLUDE_DIR=Rabbitmqc_INCLUDE_DIR-NOTFOUND

Rabbitmqc_LIBRARY=Rabbitmqc_LIBRARY-NOTFOUND


Install the library (dev version) and try again. If the library is already
installed, use ccmake to set the missing variables manually.

How can I install the library? And what is values for this variables?
You should 'build' the INSTALL target when building rabbitmq-c, which will put the files in CMAKE_INSTALL_PREFIX (you can change this in CMake). When you call CMake on SimpleAmqpClient set Rabbitmqc_INCLUDE_DIR to the path containing amqp.h, and set Rabbitmqc_LIBRARY to the rabbitmq.1.lib

Thank you.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nikita Black

unread,
Sep 11, 2014, 7:24:34 AM9/11/14
to rabbitm...@googlegroups.com, mynameisn...@gmail.com
Thank you, that was partially helpful. I had to specify paths for boost_chrono and boost_system libs manually. BOOST_ROOT and BOOST_INCLUDEDIR seems not used. But still I have a problem - I could build only dynamic libraries. Is it possible to have one single static library?

суббота, 6 сентября 2014 г., 18:24:08 UTC+2 пользователь Alan Antonuk написал:

Alan Antonuk

unread,
Sep 11, 2014, 11:41:26 AM9/11/14
to Nikita Black, rabbitm...@googlegroups.com
Currently SimpleAmqpClient and rabbitmq-c cannot be built at a static library on Win32.

-Alan

Nikita Black

unread,
Sep 12, 2014, 5:51:09 AM9/12/14
to rabbitm...@googlegroups.com, mynameisn...@gmail.com
Thank you. I've tried a lot and built a lib, but my code can't see exported functions (although they are exist, according to dumpbin). Any reasons why I can't build it? And what's the best way for me now? I don't want to distribute boost libs as well as rabbitmq-c lib together with SimpleAmpqClient lib.

четверг, 11 сентября 2014 г., 17:41:26 UTC+2 пользователь Alan Antonuk написал:

Alan Antonuk

unread,
Sep 12, 2014, 11:31:25 AM9/12/14
to Nikita Black, rabbitm...@googlegroups.com
It was a design decision based on the way symbols must be marked on Win32:

When building a DLL symbols exported must be marked with __declspec(dllexport), building code that consumes those APIs the symbols must be marked with a corresponding __declspec(dllimport).

When building a static library on the other hand, you should not mark symbols with anything, and when consuming from a static library the same applies.

I as the library developer have control when I'm building the library so I can correctly add or not add __declspec(dllexport), I don't have that same control when other are building their code against that library; and as far as I know there's no way to know from within a header whether the developer is going to link against a static or dll version of the library.

I did consider adding a pre-processor symbol that an external developer could use to indicate that they were going to compile against the static library, but didn't implement it.

-Alan

Nikita Black

unread,
Sep 15, 2014, 3:58:46 AM9/15/14
to rabbitm...@googlegroups.com, mynameisn...@gmail.com
Thank you, Alan.

пятница, 12 сентября 2014 г., 17:31:25 UTC+2 пользователь Alan Antonuk написал:

Vikash gupta

unread,
Nov 8, 2017, 8:31:22 AM11/8/17
to rabbitmq-users
Hello Nitika and Alan Antonuk..


I am also want to use AMQP-CPP library in windows visual studio 2017.I have installed AMQP-CPP from NuGet Package in visuak studio . But i am not able to implement correctly .

Please suggest me something that how to proceed.



Thanks in advance.

Kiran D

unread,
Nov 8, 2017, 7:03:27 PM11/8/17
to rabbitmq-users
I use the Windows build in two applications : 
  1. A 64-bit application which has Boost and rabbitmq-c statically linked to SimpleAmqpClient dll. The application then links to SimpleAmqpClient.dll and OpenSSL libraries at runtime.
  2. A 32-bit application which links to SimpleAmpqClient, rabbitmq-c, boost and openSSL dlls dynamically.
How I setup the build system:
1. Boost libraries are also available pre-compiled for your build configuration online. Follow the link for Windows Prebuilt libraries from http://www.boost.org/users/download/. I am using Boost 1.59.
2. Use CMake to generate msvc solutions for rabbitmq-c and SimpleAmqpClient. I did not face issues with CMake locating required version of Boost at this step. I have copied BOOST env variables from my build system below:

BOOST_INCLUDEDIR=D:\Program Files\boost_1_59_0
BOOST_LIBRARYDIR=D:\Program Files\boost_1_59_0\lib64-msvc-14.0
BOOST_ROOT=D:\Program Files\boost_1_59_0

3. After the solutions are created, I verified the project include paths, library paths in VS and built the libraries depending on my target configuration. You probably have to look up how to link libraries statically and dynamically for a Windows application online. Copy the dlls to your executable location eventually.

4. Pay attention to the nomenclature of boost libraries.

Regards,
Kiran

Vikash gupta

unread,
Nov 10, 2017, 5:27:43 AM11/10/17
to rabbitmq-users
Hello Guys,

I am new for rabbit mq. I have installed SimpleAmqpClient  from nuget package visual studio 2017 (windows ) but i am getting some issue. 
I have added simpleamqpclient header and try  to run in vs2017 then i showing libeay32.dll missing.
I have download and copy to executable folder again its showing error "the ordinal 3873 could not be located in the dynamic library LIBEAY32.dll".
Please suggest me what should i do.

Michael Klishin

unread,
Nov 10, 2017, 5:48:32 AM11/10/17
to rabbitm...@googlegroups.com
You should start a new thread instead of posting to existing ones. This is mailing list etiquette 101.

In that thread, consider providing more details, such as answers to a few simple questions:

What were the steps taken? What are the expectations? What's the outcome? What's in server logs?
What does your code look like. Please help others help you.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Michael Klishin

unread,
Nov 10, 2017, 5:49:15 AM11/10/17
to rabbitm...@googlegroups.com
Nevermind, you are the topic starter. Answers to the questions above are still relevant.

To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Michael Klishin

unread,
Nov 10, 2017, 5:51:53 AM11/10/17
to rabbitm...@googlegroups.com
A quick Google search suggests "the ordinal 3873 could not be located in the dynamic library LIBEAY32.dll" is not specific to RabbitMQ C++ client(s).


Reply all
Reply to author
Forward
0 new messages