[Insight-users] error compiling with gcc4.4.1

Bill Lorensen bill.lorensen at gmail.com
Mon Apr 26 08:25:12 EDT 2010


Sergio,

It seems that both
ITK_USE_PTHREADS and
ITK_USE_WIN32_THREADS are enabled.

My mingw has only
ITK_USE_WIN32_THREADS

Did you set either of these when you configured with CMake? I did not
set either. The cmake configuration set them for me.

Bill

On Mon, Apr 26, 2010 at 6:43 AM, Sergio Vera <sergio.vera at alma3d.com> wrote:
> Hello folks,
>
> if it may be helpful, I'm having problems too, when compiling ITK 3.18.0
> with gcc 4.4.0
>
> My setup is:
> Windows 7 64 bits.
> GCC 4.4.0 under MinGW32
> CXX and CC variables set to g++ and gcc
>
> The compilation fails with the following error:
>
> Linking CXX static library ../../bin/libitkvnl_inst.a
> [ 44%] Built target itkvnl_inst
> [ 44%] Building CXX object
> Code/Common/CMakeFiles/ITKCommon.dir/itkBarrier.obj
> In file included from
> C:/work/src/InsightToolkit-3.18.0/Code/Common/itkConditionVariable.h:31,
>                  from
> C:/work/src/InsightToolkit-3.18.0/Code/Common/itkBarrier.h:21,
>                  from
> C:/work/src/InsightToolkit-3.18.0/Code/Common/itkBarrier.cxx:17:
> C:/work/src/InsightToolkit-3.18.0/Code/Common/itkMutexLock.h:50: error:
> conflicting declaration 'typedef void* itk::MutexType'
> C:/work/src/InsightToolkit-3.18.0/Code/Common/itkMutexLock.h:46: error:
> 'itk::MutexType' has a previous declaration as 'typedef struct
> pthread_mutex_t_* itk::MutexType'
> make[2]: *** [Code/Common/CMakeFiles/ITKCommon.dir/itkBarrier.obj] Error 1
> make[1]: *** [Code/Common/CMakeFiles/ITKCommon.dir/all] Error 2
> make: *** [all] Error 2
>
> Output of gcc -v
>
>> c:\work\bin\itk\3.18.0\gcc440-MinGW32-Release>gcc -v
>> Using built-in specs.
>> Target: mingw32
>> Configured with: ../gcc-4.4.0/configure
>> --enable-languages=c,ada,c++,fortran,java,objc,obj-c++
>> --disable-sjlj-exceptions --enable-shared --enable-libgcj --enable-libgomp
>> --with-dwarf2 --disable-win32-
>> registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs
>> --prefix=/mingw --with-gmp=/mingw/src/gmp/root
>> --with-mpfr=/mingw/src/mpfr/root --build=mingw32
>> Thread model: win32
>> gcc version 4.4.0 (GCC)
>
> Note that I have several gcc versions installed but at this compilation
> time, all env variables and paths seemed to point to the correct version of
> gcc
>
> Regards
>
> On Sun, Apr 25, 2010 at 5:33 PM, Luis Ibanez <luis.ibanez at kitware.com>
> wrote:
>>
>> Eugen,
>>
>> As Bill pointed out, we build ITK with gcc 4.4.1 on a regular basis.
>>
>> That's is indeed the compiler version in both my Ubuntu 9.10
>> laptop (macondo.kitware) and desktop (eldorado.kitware).
>>
>> The second machine (eldorado.kitware) submits two Nightly
>> builds to the ITK Dashboard:
>>
>>
>> http://www.cdash.org/CDash/index.php?project=Insight&filtercount=1&showfilters=1&field1=site/string&compare1=63&value1=eldorado
>>
>>
>>
>> It is likely that you are simply dealing with a configuration
>> problem.
>>
>> 1) What is your platform ? (Linux distribution, Cygwin, MinGW ?)
>>
>> 2) Do you have other versions of GCC installed as well ?
>>
>> 3) Did you set up the environment variables CXX and CC
>>     to the locations of your g++-4.4  and gcc-4.4 executables
>>     (respectively).
>>
>>
>>
>>     Please let us know what you find.
>>
>>
>>         Thanks
>>
>>
>>
>> --------------------------------------------------------------------------------------------
>> On Sat, Apr 24, 2010 at 11:47 PM, Bill Lorensen <bill.lorensen at gmail.com>
>> wrote:
>>>
>>> Strange... we have nightly builds with 4.4.3.
>>>
>>> On Sat, Apr 24, 2010 at 5:25 PM, Eugen Funk <eugen.funk at gmail.com> wrote:
>>> > Hey,
>>> > I wanted to try out the impressive toolkit but unfortunately the
>>> > compilation
>>> > went wrong.
>>> > I receive this message:
>>> >
>>> > In file included from
>>> >
>>> > /home/eugen/development/slam/Installationen/InsightToolkit/InsightToolkit-3.18.0/Utilities/itkjpeg/jmemnobs.c:20:
>>> >
>>> > /home/eugen/development/slam/Installationen/InsightToolkit/InsightToolkit-3.18.0/Utilities/itkjpeg/jpeglib.h:78:
>>> > error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’
>>> > token
>>> >
>>> > Did anybody experienced the same?
>>> > Cmake configuration worked well (at least with no fatal errors)
>>> > so i assume, that the problem ist my relative new compiler  version:
>>> > gcc
>>> > 4.4.1
>>> >
>>> > I hope somebidy already had similar problem and can give a hint how to
>>> > resolve it.
>>> >
>>> > thanks alot in advance!
>>> >
>>> >
>>> >
>>> > _____________________________________
>>> > 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
>>
>>
>> _____________________________________
>> 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
>>
>
>
>
> --
> Sergio Vera
>
> Alma IT Systems
> C/ Vilana, 4B, 4º 1ª
> 08022 Barcelona
> T. (+34) 932 380 592
> www.alma3d.com
>


More information about the Insight-users mailing list