activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikmela <>
Subject Problem using ActiveMQ-CPP interfaces where std::string are used as parameters
Date Wed, 14 Dec 2011 17:41:54 GMT
I'm having a lot of issues passing std::strings into ActiveMQ-CPP interfaces,
i.e. Connection, Session, Message and etc.
Even though I'm using MS VS2010 to build both activemq-cpp dll and my
application with the same version of multithreaded c-runtime dll
MSVCP100.dll, MSVCR100.dll(/MD) , string object passed from the app to
activevemq-cpp dll looks corrupted in debugger when I step into activemq-cpp
I'm wondering if anyone else experienced this issue...
In general, I'm kind of surprised that std::strings where chosen for public
JMS public interfaces as it creates binary compatibility issue between the
app and dll. std::string is a class that does dynamic memory management. You
cannot pass std::string between DLL and app unless

1) The DLL and application must be built with the same compiler, version,
compiler settings, and exact same version of STL. You cannot mix and match
compilers and settings between app and DLL. 

2) The DLL and application must be using the DLL version of the runtime
library. Otherwise the two std::strings would be using two different heap
managers, causing a problem.

All the above make it difficult to maintain your app... Everytime, you move
to build an app with newer compiler you need to rebuild activemq-cpp as

Wouldn't it be better to stick to primitive const char* instead?  

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message