[Insight-users] compilation errors with mingw

Bill Lorensen bill.lorensen at gmail.com
Fri Dec 10 15:05:41 EST 2010


I build every day with mingw. I am surprised you are having problems.

On Fri, Dec 10, 2010 at 10:31 AM, Arnaud GELAS
<arnaud_gelas at hms.harvard.edu> wrote:
> Markus, Luis,
>
> I have tried both following solutions, i.e.
>
> 1-     CMAKE_USE_PTHREADS=ON
>        CMAKE_USE_WIN32_THREADS=OFF
>
>        I get the link errors (see end of the message)
>
> 2-     CMAKE_USE_PTHREADS=OFF
>        CMAKE_USE_WIN32_THREADS=ON
>
>        It seems to compile without any problem (still compiling though).
>
> Thanks,
> Arnaud
>
> ---
>
> [ 49%] Building CXX object
> Code/Common/CMakeFiles/ITKCommon.dir/itkSmartPointerF
> orwardReferenceProcessObject.cxx.obj
> Linking CXX shared library ..\..\bin\libITKCommon.dll
> Creating library file: ..\..\bin\libITKCommon.dll.a
> CMakeFiles\ITKCommon.dir/objects.a(itkConditionVariable.cxx.obj):itkConditionVar
> iable.cxx:(.text+0x2e): undefined reference to `_imp__pthread_mutex_init'
> CMakeFiles\ITKCommon.dir/objects.a(itkConditionVariable.cxx.obj):itkConditionVar
> iable.cxx:(.text+0x46): undefined reference to `_imp__pthread_cond_init'
> CMakeFiles\ITKCommon.dir/objects.a(itkConditionVariable.cxx.obj):itkConditionVar
> iable.cxx:(.text+0x9e): undefined reference to `_imp__pthread_mutex_init'
> CMakeFiles\ITKCommon.dir/objects.a(itkConditionVariable.cxx.obj):itkConditionVar
> iable.cxx:(.text+0xb6): undefined reference to `_imp__pthread_cond_init'
> CMakeFiles\ITKCommon.dir/objects.a(itkConditionVariable.cxx.obj):itkConditionVar
> iable.cxx:(.text+0xfb): undefined reference to `_imp__pthread_mutex_destroy'
> CMakeFiles\ITKCommon.dir/objects.a(itkConditionVariable.cxx.obj):itkConditionVar
> iable.cxx:(.text+0x10b): undefined reference to `_imp__pthread_cond_destroy'
> CMakeFiles\ITKCommon.dir/objects.a(itkConditionVariable.cxx.obj):itkConditionVar
> iable.cxx:(.text+0x16f): undefined reference to
> `_imp__pthread_mutex_destroy'
> CMakeFiles\ITKCommon.dir/objects.a(itkConditionVariable.cxx.obj):itkConditionVar
> iable.cxx:(.text+0x17f): undefined reference to `_imp__pthread_cond_destroy'
> CMakeFiles\ITKCommon.dir/objects.a(itkConditionVariable.cxx.obj):itkConditionVar
> iable.cxx:(.text+0x1e3): undefined reference to
> `_imp__pthread_mutex_destroy'
> CMakeFiles\ITKCommon.dir/objects.a(itkConditionVariable.cxx.obj):itkConditionVar
> iable.cxx:(.text+0x1f3): undefined reference to `_imp__pthread_cond_destroy'
> CMakeFiles\ITKCommon.dir/objects.a(itkConditionVariable.cxx.obj):itkConditionVar
> iable.cxx:(.text+0x24c): undefined reference to `_imp__pthread_cond_signal'
> CMakeFiles\ITKCommon.dir/objects.a(itkConditionVariable.cxx.obj):itkConditionVar
> iable.cxx:(.text+0x264): undefined reference to
> `_imp__pthread_cond_broadcast'
> CMakeFiles\ITKCommon.dir/objects.a(itkConditionVariable.cxx.obj):itkConditionVar
> iable.cxx:(.text+0x28b): undefined reference to `_imp__pthread_cond_wait'
> CMakeFiles\ITKCommon.dir/objects.a(itkMultiThreader.cxx.obj):itkMultiThreader.cx
> x:(.text+0x17b0): undefined reference to `_imp__pthread_attr_init'
> CMakeFiles\ITKCommon.dir/objects.a(itkMultiThreader.cxx.obj):itkMultiThreader.cx
> x:(.text+0x17c5): undefined reference to `_imp__pthread_attr_setscope'
> CMakeFiles\ITKCommon.dir/objects.a(itkMultiThreader.cxx.obj):itkMultiThreader.cx
> x:(.text+0x187c): undefined reference to `_imp__pthread_create'
> CMakeFiles\ITKCommon.dir/objects.a(itkMultiThreader.cxx.obj):itkMultiThreader.cx
> x:(.text+0x18f8): undefined reference to `_imp__pthread_join'
> CMakeFiles\ITKCommon.dir/objects.a(itkMultiThreader.cxx.obj):itkMultiThreader.cx
> x:(.text+0x1c68): undefined reference to `_imp__pthread_attr_init'
> CMakeFiles\ITKCommon.dir/objects.a(itkMultiThreader.cxx.obj):itkMultiThreader.cx
> x:(.text+0x1c7d): undefined reference to `_imp__pthread_attr_setscope'
> CMakeFiles\ITKCommon.dir/objects.a(itkMultiThreader.cxx.obj):itkMultiThreader.cx
> x:(.text+0x1cc4): undefined reference to `_imp__pthread_create'
> CMakeFiles\ITKCommon.dir/objects.a(itkMultiThreader.cxx.obj):itkMultiThreader.cx
> x:(.text+0x1d68): undefined reference to `_imp__pthread_join'
> CMakeFiles\ITKCommon.dir/objects.a(itkMultiThreader.cxx.obj):itkMultiThreader.cx
> x:(.text+0x1f71): undefined reference to `_imp__pthread_join'
> CMakeFiles\ITKCommon.dir/objects.a(itkMultiThreader.cxx.obj):itkMultiThreader.cx
> x:(.text+0x210c): undefined reference to `_imp__pthread_attr_init'
> CMakeFiles\ITKCommon.dir/objects.a(itkMultiThreader.cxx.obj):itkMultiThreader.cx
> x:(.text+0x2121): undefined reference to `_imp__pthread_attr_setscope'
> CMakeFiles\ITKCommon.dir/objects.a(itkMultiThreader.cxx.obj):itkMultiThreader.cx
> x:(.text+0x2144): undefined reference to `_imp__pthread_create'
> CMakeFiles\ITKCommon.dir/objects.a(itkMutexLock.cxx.obj):itkMutexLock.cxx:(.text
> +0x65): undefined reference to `_imp__pthread_mutex_init'
> CMakeFiles\ITKCommon.dir/objects.a(itkMutexLock.cxx.obj):itkMutexLock.cxx:(.text
> +0x8f): undefined reference to `_imp__pthread_mutex_init'
> CMakeFiles\ITKCommon.dir/objects.a(itkMutexLock.cxx.obj):itkMutexLock.cxx:(.text
> +0xb1): undefined reference to `_imp__pthread_mutex_destroy'
> CMakeFiles\ITKCommon.dir/objects.a(itkMutexLock.cxx.obj):itkMutexLock.cxx:(.text
> +0xe7): undefined reference to `_imp__pthread_mutex_destroy'
> CMakeFiles\ITKCommon.dir/objects.a(itkMutexLock.cxx.obj):itkMutexLock.cxx:(.text
> +0x11d): undefined reference to `_imp__pthread_mutex_destroy'
> CMakeFiles\ITKCommon.dir/objects.a(itkMutexLock.cxx.obj):itkMutexLock.cxx:(.text
> +0x14a): undefined reference to `_imp__pthread_mutex_lock'
> CMakeFiles\ITKCommon.dir/objects.a(itkMutexLock.cxx.obj):itkMutexLock.cxx:(.text
> +0x162): undefined reference to `_imp__pthread_mutex_unlock'
> CMakeFiles\ITKCommon.dir/objects.a(itkSemaphore.cxx.obj):itkSemaphore.cxx:(.text
> +0x7d): undefined reference to `_imp__sem_init'
> CMakeFiles\ITKCommon.dir/objects.a(itkSemaphore.cxx.obj):itkSemaphore.cxx:(.text
> +0x21d): undefined reference to `_imp__sem_post'
> CMakeFiles\ITKCommon.dir/objects.a(itkSemaphore.cxx.obj):itkSemaphore.cxx:(.text
> +0x3bd): undefined reference to `_imp__sem_wait'
> CMakeFiles\ITKCommon.dir/objects.a(itkSemaphore.cxx.obj):itkSemaphore.cxx:(.text
> +0x6b7): undefined reference to `_imp__sem_destroy'
> CMakeFiles\ITKCommon.dir/objects.a(itkSimpleFastMutexLock.cxx.obj):itkSimpleFast
> MutexLock.cxx:(.text+0x15): undefined reference to
> `_imp__pthread_mutex_init'
> CMakeFiles\ITKCommon.dir/objects.a(itkSimpleFastMutexLock.cxx.obj):itkSimpleFast
> MutexLock.cxx:(.text+0x33): undefined reference to
> `_imp__pthread_mutex_init'
> CMakeFiles\ITKCommon.dir/objects.a(itkSimpleFastMutexLock.cxx.obj):itkSimpleFast
> MutexLock.cxx:(.text+0x49): undefined reference to
> `_imp__pthread_mutex_destroy'
>
> CMakeFiles\ITKCommon.dir/objects.a(itkSimpleFastMutexLock.cxx.obj):itkSimpleFast
> MutexLock.cxx:(.text+0x5f): undefined reference to
> `_imp__pthread_mutex_destroy'
>
> CMakeFiles\ITKCommon.dir/objects.a(itkSimpleFastMutexLock.cxx.obj):itkSimpleFast
> MutexLock.cxx:(.text+0x75): undefined reference to
> `_imp__pthread_mutex_lock'
> CMakeFiles\ITKCommon.dir/objects.a(itkSimpleFastMutexLock.cxx.obj):itkSimpleFast
> MutexLock.cxx:(.text+0x8b): undefined reference to
> `_imp__pthread_mutex_unlock'
> collect2: ld returned 1 exit status
> mingw32-make[2]: *** [bin/libITKCommon.dll] Error 1
> mingw32-make[1]: *** [Code/Common/CMakeFiles/ITKCommon.dir/all] Error 2
> mingw32-make: *** [all] Error 2
>
> C:\DEVEL\BUILD\ITK>
>
>
>
> On 12/10/2010 07:06 AM, Markus Neuner wrote:
>>
>> Ok sorry, pasting mistake
>>
>> should be:
>>
>> CMAKE_USE_PTHREADS=ON
>> CMAKE_USE_WIN32_THREADS=OFF
>>
>>
>> On 10.12.2010 13:04, Markus Neuner wrote:
>>>
>>> Hi Arnaud,
>>>
>>> Look at the cmake variables and ensure that
>>> CMAKE_USE_WIN32_THREADS=ON
>>> and
>>> CMAKE_USE_WIN32_THREADS=OFF
>>>
>>> I hope this can solve your problem.
>>>
>>>
>>>
>>> On 08.12.2010 16:32, Gelas, Arnaud Joel Florent wrote:
>>>
>>>> Hi all,
>>>>
>>>> I am trying to compile ITK with mingw and I get the following errors:
>>>>
>>>> [ 46%] Building CXX object
>>>> Code/Common/CMakeFiles/ITKCommon.dir/itkConditionVari
>>>> able.cxx.obj
>>>> C:\DEVEL\ITK\Code\Common\itkConditionVariable.cxx: In member function
>>>> 'void itk:
>>>> :ConditionVariable::Wait(itk::SimpleMutexLock*)':
>>>> C:\DEVEL\ITK\Code\Common\itkConditionVariable.cxx:132: error: invalid
>>>> conversion
>>>>  from 'int' to 'void*'
>>>> C:\DEVEL\ITK\Code\Common\itkConditionVariable.cxx:132: error:
>>>> initializing arg
>>>> ument 1 of 'DWORD SignalObjectAndWait(void*, void*, DWORD, BOOL)'
>>>> C:\DEVEL\ITK\Code\Common\itkConditionVariable.cxx:153: error: invalid
>>>> conversion
>>>>  from 'int' to 'void*'
>>>> C:\DEVEL\ITK\Code\Common\itkConditionVariable.cxx:153: error:
>>>> initializing arg
>>>> ument 2 of 'DWORD SignalObjectAndWait(void*, void*, DWORD, BOOL)'
>>>> C:\DEVEL\ITK\Code\Common\itkConditionVariable.cxx:159: error: invalid
>>>> conversion
>>>>  from 'int' to 'void*'
>>>> C:\DEVEL\ITK\Code\Common\itkConditionVariable.cxx:159: error:
>>>> initializing arg
>>>> ument 1 of 'DWORD WaitForSingleObject(void*, DWORD)'
>>>> mingw32-make[2]: ***
>>>> [Code/Common/CMakeFiles/ITKCommon.dir/itkConditionVariable.
>>>> cxx.obj] Error 1
>>>> mingw32-make[1]: *** [Code/Common/CMakeFiles/ITKCommon.dir/all] Error 2
>>>> mingw32-make: *** [all] Error 2
>>>>
>>>>
>>>> Do I need to change anything while configuring with CMake or is it a
>>>> real compilation error?
>>>>
>>>> Thanks,
>>>> Arnaud
>>>>
>>>> _____________________________________
>>>> Powered by www.kitware.com
>>>>
>>>> Visit other Kitware open-source projects at
>>>> http://www.kitware.com/opensource/opensource.html
>>>>
>>>> Kitware offers ITK Training Courses, for more information visit:
>>>> http://www.kitware.com/products/protraining.html
>>>>
>>>> Please keep messages on-topic and check the ITK FAQ at:
>>>> http://www.itk.org/Wiki/ITK_FAQ
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://www.itk.org/mailman/listinfo/insight-users
>>>>
>>>>
>>>>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list