[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xmlblaster-devel] Re: cvs adding


For your library to build and become a dll it must export the c++ within. To
facilitate this you must "export" the classes and "import" them when linking
to the lib. This is acheived via the windows
only macro __declspec.

To do this successfully a header containing the following must be included
by all headers containing classes expected to be instantiated by users of
the lib. There is a little TAO specific stuff at the end of it.

# if defined(_WINDOWS)
#  define Blaster_Export_Flag __declspec (dllexport)
#  define Blaster_Import_Flag __declspec (dllimport)
# if defined(DLL_BUILD)
#    define Dll_Export Blaster_Export_Flag
#  else
#    define Dll_Export Blaster_Import_Flag
# endif
# else
#  define Dll_Export
# endif

# if defined (TAO_EXPORT_MACRO)
# endif
# define TAO_EXPORT_MACRO Dll_Export

Then the following is added to all headers containg classes that expect to
be instantiated by the users of the lib. Please see snippet below.

using namespace std;

namespace org { namespace xmlBlaster {
namespace util {

   class Dll_Export Log {


Are you OK with this or have an a better solution.