activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Motl <>
Subject static and global objects
Date Thu, 26 Apr 2007 08:22:26 GMT


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

./activemq/network/TcpSocket.h:            static StaticSocketInitializer
./activemq/network/ServerSocket.h:          static
StaticServerSocketInitializer staticSocketInitializer;
./activemq/transport/IOTransportFactory.h:        static
TransportFactoryMapRegistrar registrar;
./activemq/support/LibraryInit.h:    static activemq::support::InitDirector
./activemq/util/Queue.h:        static T safe;
./activemq/logger/LogWriter.h:      static concurrent::Mutex mutex;
./activemq/logger/LoggerDefines.h:   static activemq::logger::SimpleLogger
./activemq/logger/LogManager.h:        static concurrent::Mutex mutex;
./activemq/concurrent/ThreadPool.h:        static ThreadPool instance;
./activemq/connector/stomp/commands/CommandConstants.h:        static
StaticInitializer staticInits;
static utils::HexTable hexTable;
./activemq/core/ActiveMQConstants.h:        static StaticInitializer

Having done this, we could start supporting MinGW.

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

View raw message