[Paraview] VTK_IO_EXPORT vs VTK_EXPORT (VTK_ABI_IMPORT vs VTK_ABI_EXPORT)

Marcus D. Hanwell marcus.hanwell at kitware.com
Sat Apr 16 09:24:29 EDT 2011


On Sat, Apr 16, 2011 at 6:10 AM, Xunlei Wu <xunlei at renci.org> wrote:
> Hi All,
>
> Could anyone please explain the difference between VTK_IO_EXPORT and
> VTK_EXPORT (beyond the below definition)? I am writing a file reader plugin
> and defined my class as VTK_EXPORT. However, many VTK/IO/ reader examples,
> e.g. vtkAVSucdReader, vtkImageReader are defined as VTK_IO_EXPORT. From the
> source code,
>
> #define VTK_EXPORT VTK_ABI_EXPORT
>
> #if defined(vtkIO_EXPORTS)
>   #define VTK_IO_EXPORT VTK_ABI_EXPORT
> #else
>   #define VTK_IO_EXPORT VTK_ABI_IMPORT
> #endif

There is only a different on the Windows platform, but if you notice
it only exports if vtkIO_EXPORTS is defined, otherwise it imports.
THis is necessary for DLLs on Windows, all though platforms that
support symbol visibility only have a concept of exporting. So a macro
is needed for each DLL in order to ensure the symbols are
imported/exported correctly for shared windows libraries.

Marcus


More information about the ParaView mailing list