[MOAB-dev] question: MB_DLL_EXPORT

Jason Kraftcheck kraftche at cae.wisc.edu
Thu Oct 9 11:36:28 CDT 2008


de Almeida, Valmor F. wrote:
> Is MB_DLL_EXPORT actually used in MOAB

Yes.

> or does it evaluate to empty when
> using gcc/linux? 
> 

Yes.  It is currently not used on non-Windows systems.  We could choose to
use it in the future to reduce the visible symbols in a MOAB shared library
to only those we intend to export by defining it to expand to the
appropriate GCC attribute and changing the default symbol visibility.

> I've never seen this syntax:
> 
>   class MB_DLL_EXPORT ReadHDF5 {  ........ };
> 
> where a qualifier sits in between the class keyword and the class
> symbol. Is this a Microsoft C++ syntax for the Windows OS?
> 

Many build tools (e.g. Visual C++) on Windows require a compiler-specific
attribute to specify which symbols are exported in a shared library.  Also,
as far as I know, all compilers require a different compiler attribute to
specify which symbols are imported from a Windows shared library (dll) when
compiling an application.

> If MB_DLL_EXPORT is eliminated, would it break MOAB?
> 

It will break the MOAB build on Windows.

- jason




More information about the moab-dev mailing list