[vtkusers] Build problems with Cygwin

Carl Hetherington lists at carlh.net
Wed Dec 19 08:18:14 EST 2001


On Tue, 18 Dec 2001, Mumit Khan wrote:

> On Tue, 18 Dec 2001, Carl Hetherington wrote:
> 
> > I'm trying to build a CVS checkout of VTK (from a few days ago) using
> > a fresh install of Cygwin on Windows 98.
> 
> [ I'm assuming this is VTK 4, otherwise my comments won't much sense ]

Yes it is, sorry.
 
> Have you been bitten by the x86-windows gcc dll export bug where the
> second CopyData and CopyAllocate members of vtkDataSetAttributes are
> not exported? It's a bug deep inside the compiler, tweaked by the
> nested structure FieldList that is also exported. I wonder how you
> got around that to go all the way to building the executables?

Adding -lgdi32 to CMAKE_DL_LIBS (as you suggested) makes the build work
fine, although I'm not building shared libs at the moment.  That's the
next thing I want to try, so perhaps I'll see these problems then.
 
> The way you know you've hit the bug is if you see a link error that
> involves vtkDataSetAttributes::CopyData when building one of the
> other DLLs.

Right, I'll look out for that when I build the shared libs.

> If you have run into it, the fix is to put the following bit before
> the CopyData and CopyAllocate (the second form that takes the
> FieldList as an arg) definitions in vtkDataSetAttributes.cxx:
> 
>   #ifdef __GNUC__
>   /* Work around GCC/Windows bug that will not auto-export if the member
>     declaration is after a local class that is also exported. */
>   VTK_COMMON_EXPORT
>   #endif /* __GNUC__ */

Thanks.

> > It gets a fair old way down the line before bombing out with
> >
> >
> > GetStockObject appears to be a Win32 API function; perhaps there should be
> > a -mwindows on that last link line?  The libraries seem to be a bit
> > mucked up anyway with the repeated -lpthread -lm -lvtkCommon.
> 
> You're missing -lgdi32 on the command line (or you can use -mwindows,
> which adds -lgdi32 among other things at link time).
> 
> Check CMAKE_DL_LIBS setting in CMakeCache.txt (and in CMakeSystemConfig.txt).

That's it :-)

The static libraries and test executables have built ok now, it would
seem.

Thanks,
Carl





More information about the vtkusers mailing list