SimpleAmqpClient
SimpleAmqpClient copied to clipboard
Support for C++11
Add support for using SimpleAmqpClient when the C++ compiler is in -std=c++11 or -std=c++0x mode.
I won't assert that this fixes all -std=c++0x compilation issues, but we had to make the following change in SimpleAmqpClient/BasicMessage.h:
Replacing the line
#include <boost/make_shared.hpp>
with:
#ifdef BOOST_HAS_RVALUE_REFS
#undef BOOST_HAS_RVALUE_REFS
#include <boost/make_shared.hpp>
#define BOOST_HAS_RVALUE_REFS
#else
#include <boost/make_shared.hpp>
#endif
What version of gcc and boost were you using?
In our case, this fix was for gcc 4.6.3, boost 1.52.0.
I've just confirmed that this change fixes the particular issue I was having with -std=c++0x on gcc 4.6.3 and boost 1.51.0.
I should have said in my first post: clearly this is a hack; we haven't had a chance to identify the correct solution.
I have another work around which works also with boost 1.53.0 and SimpleAmqpClient 2.2.0
#define BOOST_NO_CXX11_RVALUE_REFERENCES #include <SimpleAmqpClient/SimpleAmqpClient.h>
@SAbruzzo - what compiler did that workaround work for?
@alanxz : silvio@pc:~$ g++ --version g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
and I use -std=c++0x
Workaround for compiling on Mac OS X/Clang under std=c++-11
Add the following cmake flags:
-DCMAKE_CXX_FLAGS="-std=c++-11 -stdlib=libc++ -DGTEST_USE_OWN_TR1_TUPLE=1"
Hello Friends ,
I have installed SimpleAmqpClient library in visual studio from nuget package . I have just added header #include <SimpleAmqpClient/SimpleAmqpClient.h> and execute my program then it is showing SSLEAY32.dll missing . Please suggest me what should i do.
Thanks in advance
@vikaschamp you likely need to install OpenSSL.
Unconditionally disabling rvalues for boost::shared_ptr in the library seems like a very bad idea. It seems like it could also lead to ODR violations.
@capsocrates yup. The path forward here is likely not to enable/disable rvalue references, but to replace boost::shared_ptr with something like std::unique_ptr.