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

David C Thompson dcthomp at sandia.gov
Mon Oct 22 13:51:11 EDT 2007


Brad et al.,

Things appear to work now except for the mingw build:
http://www.vtk.org/Testing/Sites/dash14.kitware/Win32-mingw/20071022-0300-Nightly/BuildError.html
Does anyone familiar with ming recognize these errors? When I look at
them, it appears that the VTK_*_EXPORT macros are working as expected
(i.e., when vtkFiltering is being compiled, members implemented in
vtkCommon are marked dllimport and members implemented in vtkFiltering
are marked dllexport). But the compiler doesn't appear to like the
dllimport marks.

	David

On Sun, 2007-10-21 at 16:18 -0600, Thompson, David C wrote:
> 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
> 
> 
> 
> 
> 




More information about the vtk-developers mailing list