[Insight-developers] itkFactoryTestLib.cxx & Sun CC

Tom Vercauteren tom.vercauteren at m4x.org
Fri Apr 3 09:06:52 EDT 2009


Hi,

I am going to need help on that one:
http://www.cdash.org/CDash/viewBuildError.php?buildid=305373

Sun cc compiler seems to not like the std::allocator :(

I should be able to fix the "Cannot assign void* to XXX*" easily by
simply adding an explicit static_cast.

However I don't know how to handle the "destroy is not a member of
std::allocator" issue. The only interesting information I found is
here:
  http://forums.sun.com/thread.jspa?threadID=5317335
where two possible compiler options are proposed to fix the problem:
  -library=stlport4
or
  -D_RWSTD_ALLOCATOR

Having absolutely no experience of sun, I have no clue whether any of
those options seems reasonable for ITK.

Another option of course would be to drop the use of std::allocator
either entirely or only for sun within that unit test. However I do
think that this std::allocator provides a nice example on how to
extend ITK.

Thoughts?

Tom

On Thu, Apr 2, 2009 at 19:53, Tom Vercauteren <tom.vercauteren at m4x.org> wrote:
> Thanks Bill,
>
> Even though, on that page
>  http://msdn.microsoft.com/en-us/library/723te7k3.aspx
> the prototype of allocate is shown as requiring 2 arguments, the
> example provided on the same page only uses one.
>
> Also, MSVC 2003 has a default argument for the second argument:
>  http://msdn.microsoft.com/en-us/library/723te7k3(VS.71).aspx
>
> Anyhow, let's see how it goes.
>
> Tom
>
> On Thu, Apr 2, 2009 at 19:42, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>> It's not just VS6. See for example:
>> http://msdn.microsoft.com/en-us/library/723te7k3.aspx
>> which is for VS 2008.
>>
>> Your fix should be portable.
>>
>> Bil
>>
>> On Thu, Apr 2, 2009 at 10:35 AM, Tom Vercauteren
>> <tom.vercauteren at m4x.org> wrote:
>>> Hey Luis,
>>>
>>> It seems that this is a known msvc 6.0 bug. See chapter 11 of
>>> http://www.acceleratedcpp.com/details/msbugs.html
>>>
>>> I'll try with adding a dummy second argument (null pointer). I hope it
>>> won't make other platforms fail...
>>> http://www.itk.org/cgi-bin/viewcvs.cgi/Testing/Code/Common/itkFactoryTestLib.cxx?root=Insight&r1=1.5&r2=1.6&sortby=date
>>>
>>> Tom
>>>
>>> On Thu, Apr 2, 2009 at 18:42, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>>>>
>>>> Hi Tom,
>>>>
>>>> It seems that Visual Studio 6.0 has difficulty
>>>> with the changes in itkFactoryTestLib.cxx:
>>>>
>>>> http://www.cdash.org/CDash/viewBuildError.php?buildid=304766
>>>>
>>>>
>>>> Compiling...
>>>> itkFactoryTestLib.cxx
>>>>
>>>> c:\Dashboards\My
>>>> Tests\InsightContinuous\Testing\Code\Common\itkFactoryTestLib.cxx(68) :
>>>> error C2660: 'allocate' : function does not take 1 parameters
>>>>
>>>>        c:\Dashboards\My
>>>> Tests\InsightContinuous\Testing\Code\Common\itkFactoryTestLib.cxx(59) :
>>>> while compiling class-template member function 'short *__thiscall
>>>> TestImportImageContainer<unsigned long,short>::AllocateElements(unsigned
>>>> long) const'
>>>>
>>>>
>>>>  Any suggestions ?
>>>>
>>>>
>>>>     Thanks
>>>>
>>>>
>>>>         Luis
>>>>
>>>>
>>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.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-developers
>>>
>>
>


More information about the Insight-developers mailing list