Hi, Eventually, I have discovered the reason why application using activemq-cpp builds but crashes under MinGW. Constructors for library static objects aren't called before main() - it's mingw compiler/liinker problem.
Is it possible to cut out all the static and global objects from the library and place this code into some activemq_init() function? I ve found 12 static objects that are of activemq type (i.e. not static std::string): ./activemq/network/TcpSocket.h: static StaticSocketInitializer staticSocketInitializer; ./activemq/network/ServerSocket.h: static StaticServerSocketInitializer staticSocketInitializer; ./activemq/transport/IOTransportFactory.h: static TransportFactoryMapRegistrar registrar; ./activemq/support/LibraryInit.h: static activemq::support::InitDirector initDirector; ./activemq/util/Queue.h: static T safe; ./activemq/logger/LogWriter.h: static concurrent::Mutex mutex; ./activemq/logger/LoggerDefines.h: static activemq::logger::SimpleLogger loggerName; ./activemq/logger/LogManager.h: static concurrent::Mutex mutex; ./activemq/concurrent/ThreadPool.h: static ThreadPool instance; ./activemq/connector/stomp/commands/CommandConstants.h: static StaticInitializer staticInits; ./activemq/connector/openwire/marshal/BaseDataStreamMarshaller.h: static utils::HexTable hexTable; ./activemq/core/ActiveMQConstants.h: static StaticInitializer staticInits; Having done this, we could start supporting MinGW. -- View this message in context: http://www.nabble.com/static-and-global-objects-tf3650248s2354.html#a10196191 Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
