[vtkusers] Build problems with Cygwin

Mumit Khan khan at nanotech.wisc.edu
Tue Dec 18 16:52:39 EST 2001


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 ]

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?

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.

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__ */

> 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).

Regards,
Mumit






More information about the vtkusers mailing list