[Insight-developers] ExceptionObject Borland Compile errors

Brad King brad.king at kitware.com
Wed May 28 08:50:49 EDT 2008


Bill Lorensen wrote:
> This is beyond my C++ expertise. There are other forward declaration
> things in other classes. Perhaps Brad or Luis can help.
> 
> On Wed, May 28, 2008 at 8:41 AM, Niels Dekker <niels-xtk at xs4all.nl> wrote:
>> Bill Lorensen wrote:
>>> Just a heads up that my continuous Borland build is reporting many
>>> compile errors after your changes. [...]I'll see if I can send
>>> you part of the error log.
>> Hmmm... Your log says things like:
>>
>>  Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
>>  C:\lorensen\Projects\InsightContinuous\Code\Common\itkDataObject.cxx:
>>  Error E2315
>> C:\lorensen\Projects\InsightContinuous\Code\Common\itkSmartPointer.h 147:
>> 'UnRegister' is not a member of
>> 'ExceptionObject::ReferenceCountedExceptionData', because the type is not
>> yet defined in function SmartPointer<const
>> ExceptionObject::ReferenceCountedExceptionData>::UnRegister()
>>
>> This looks quite bad! It looks like Borland cannot deal with
>> itk::ExceptionObject containing an itk::SmartPointer, pointing to a
>> forward-declared class (ReferenceCountedExceptionData).
>>
>> I need some time to figure out a workaround.  I don't have access to Borland
>> this afternoon...  In the meantime, should I undo my commit?  Or do you have
>> a workaround?

The itk SmartPointer is not designed for working with incomplete types.  I 
suggest making the smart pointer type point at a LightObject (or other 
complete type used as a base class for the internal data type) and then 
downcast inside the .cxx file.

-Brad


More information about the Insight-developers mailing list