[Insight-developers] Cygwin cmake 2.6 issue

Brad King brad.king at kitware.com
Wed Jun 3 08:59:54 EDT 2009


Bill Lorensen wrote:
> Brad,
> 
> Also, I think the same thing may have happened to the mingw build.
> http://www.cdash.org/CDash/viewBuildError.php?buildid=346391

It is actually a problem affecting the GNU toolchain on windows,
not just cygwin specifically.

> Did some change break this compatibility? Or is this a bugu that
> needed to be corrected?

CMake 2.6 links to the dll's import library "libITKCommon.dll.a"
instead of the dll "cygITKCommon.dll".  This is considered the
proper way to link on Windows in general, and was a bug in 2.4.
However, the linker works differently with the import library
than with the dll in some subtle ways, which led to the problem.

It was just lucky that 2.4's way worked for our case.  I would
not be surprised if it would cause some subtle runtime bugs in
similar cases.  The root cause is that we are trying to link
a shared library to static libraries and then an executable
to both that shared library and the same static libraries.
Therefore the solution is to build everything shared or static
but not both.

-Brad


More information about the Insight-developers mailing list