[Insight-users] Compilation problems with cygwin (solved)

William A. Hoffman billlist at nycap.rr.com
Thu Aug 4 11:05:52 EDT 2005


The problem is that you are using the windows CMakeSetup.  If you are building
with the cygwin gcc, you should use the cmake built for cygwin, ccmake.   You can
download cmake from the regular cygwin setup program.   That being said, this
should still work, and you may want to add a bug to the itk bug tracker asking
for support for CMakeSetup and cygwin gcc.   You may have further problems after this one.
The cygwin cmake build is part of the dashboard and should work with no changes.

-Bill



At 10:52 AM 8/4/2005, Stéphane Wasserhardt wrote:
>Just for the few newbies like me who could have the same compilation problem
>:
>The solution is easy to find if you take a look at the source code.
>
>In {insight source dir}\code\common\itkMutexLock.h are written the following
>lines :
>
>#ifdef ITK_USE_SPROC
>typedef abilock_t MutexType;
>#endif
>
>#ifdef ITK_USE_PTHREADS
>typedef pthread_mutex_t MutexType;
>#endif
>
>#ifdef ITK_USE_WIN32_THREADS
>typedef HANDLE MutexType;
>#endif
>
>#ifndef ITK_USE_SPROC
>#ifndef ITK_USE_PTHREADS
>#ifndef ITK_USE_WIN32_THREADS
>typedef int MutexType;
>#endif
>#endif
>#endif
>
>And the build error tells that "MutexType" is declared multiple times. The
>reason is that both ITK_USE_PTHREADS and ITK_USE_WIN32_THREADS were defined.
>Then the problem is just to find where these variables were defined in order
>to "undefine" ITK_USE_PTHREADS. A little grep search helped me to find that
>it was CMake which had set this variables by mean of CMAKE_USE_PTHREAD and
>CMAKE_USE_WIN32_THREADS (and CMAKE_USE_SPROC).
>So the problem was in fact that CMake detected that both pthreads and win32
>threads were available on the system, and activated both by default...
>I tried to switch off pthreads, but it didn't work so easily : another
>compilation error appeared when trying to compile code using threads, in
>ItkMultiThreader.cxx (the function "_beginthreadex" was not declared...)
>So I switched off win32 thread and tried using pthreads instead. And it
>worked !!
>
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users 



More information about the Insight-users mailing list