[vtk-developers] VTK CVS broken: vtkInformationExecutivePortVectorKey and vtkExecutive link error in Debug only

Thompson, David C dcthomp at sandia.gov
Sun Oct 21 18:18:20 EDT 2007


OK, I've spent a little (OK, a lot) more time on things and
have moved the VTK_*_EXPORT macros inside the class. However,
in order to do this, I've had to twiddle with
1. The vtkTypeMacro and vtkTypeRevisionMacro. They are now
   defined as calls to another set of macros, vtkExportedTypeMacro
   and vtkExportedTypeRevisionMacro which accept a third
   argument for specifying a VTK_*_EXPORT macro.
2. The wrapper parser. It must now accept the new macros above.
Hopefully that will be the end of it.

    David

-----Original Message-----
From: Thompson, David C
Sent: Sat 10/20/2007 1:21 PM
To: Brad King
Cc: vtk-developers at vtk.org; Berk Geveci
Subject: RE: [vtk-developers] VTK CVS broken: vtkInformationExecutivePortVectorKey and vtkExecutive link error in Debug only
 
I've tried the hack but other classes in Filtering that refer to the
methods (which, to them, appear to come from Common) are still causing
warnings. I'm going to try adding the VTK_*_EXPORT macro to each member
function and see how that works.

    David


-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com]
Sent: Sat 10/20/2007 7:26 AM
To: Thompson, David C
Cc: vtk-developers at vtk.org; Berk Geveci
Subject: Re: [vtk-developers] VTK CVS broken: vtkInformationExecutivePortVectorKey and vtkExecutive link error in Debug only
 
Thompson, David C wrote:
> Brad et al.,
> 
>     I'm seeing some warnings on Windows about inconsistent
> DLL linkage. Right now vtkInformation looks like:
> 
> class VTK_COMMON_EXPORT vtkInformation : public vtkObject
> {
>   // ...
>   void MethodInCommon();
>   void MethodInFiltering();
> };
> 
> I'm not familiar with Windows import/export behavior. Should
> I change it to
> 
> class VTK_COMMON_EXPORT vtkInformation : public vtkObject
> {
>   // ...
>   void MethodInCommon();
>   VTK_FILTERING_EXPORT void MethodInFiltering();
> };
> 
> or
> 
> class vtkInformation : public vtkObject
> {
>   // ...
>   VTK_COMMON_EXPORT    void MethodInCommon();
>   VTK_FILTERING_EXPORT void MethodInFiltering();
> };
> 
> or something else entirely?

In general the latter would be necessary.  However we should be able to
hack around this for our case as follows.  Inside
Filtering/vtkInformation.cxx, write this:

#include "vtkObject.h"
... other includes here...but not vtkInformation.h
#ifdef __vtkInformation_h
# error "vtkInformation.h must not be included before this line."
#endif
#undef VTK_COMMON_EXPORT
#define VTK_COMMON_EXPORT VTK_FILTERING_EXPORT
#include "vtkInformation.h" // must be last #include
...rest of code...

This will hack the vtkInformation class to think it is exported from
Filtering when compiled inside that one source file.  That will cause
just those methods to be exported correctly.

-Brad



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20071021/56b83ab3/attachment.html>


More information about the vtk-developers mailing list