[Insight-users] some compilation trouble when extendind itkMesh

Luis Ibanez luis.ibanez at kitware.com
Thu Jul 22 11:06:33 EDT 2004


Hi Alexandre


> 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with 
>> /GR-; unpredictable behavior may result


           You are not using CMake !


If you use CMake for configuring your project, it will take
care of setting up all the appropriate compiler flags required
for building ITK code. Instead of wasting your valuable time
wondering about these annoying details, you could have been
segmenting and registering medical images by now.

Your Visual Studio project currently have Exceptions disabled
(That's what the /GR- flag is). ITK uses exceptions for error
handling, and for taking advantage of RTTI.


Your best options at this point :


  1) Solve the immediate problem by just
     enabling the /GR flag, and wait for
     the next configuration problem to appear.


or


  2) Do the right thing and use CMake
     for configuring your project       :-)



You will find instructions on how to create a CMakeLists.txt
file for your project in the Tutorial sessions:

      http://www.itk.org/HTML/Tutorials.htm

in particular in

http://www.itk.org/CourseWare/Training/GettingStartedI-WebPage/index.htm



as well as in the first chapter of the Software Guide

     http://www.itk.org/ItkSoftwareGuide.pdf



Regards,


    Luis


---------------------------
Alexandre gouaillard wrote:

> dear all
> 
> i m experienceing some problems compiling a code extending the itkMesh 
> class.
> I m experiencing multiple times the same kind of warning and i have one 
> error which seems related to STD LIBS usage.
> my environement is as follows :
> Win XP
> MSVC++ 6.0 patched 6
> vtk, itk, fltk all compiled with this compiler , up and running for years.
> The same code seems to compile under linux without troubles (that's why 
> it so frustrating to me ^__^)
> 
> any comments, idea , solutions are more than welcome.
> (yes mathieu, i will try CMAKE one day, i promise)
> 
>  >>> warnings
> 
> insighttoolkit-1.6.0\include\itkeventobject.h(134) : warning C4541: 
> 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with 
> /GR-; unpredictable behavior may result
> insighttoolkit-1.6.0\code\common\itkobjectfactory.h(53) : warning C4541: 
> 'dynamic_cast' used on polymorphic type 'class itk::LightObject' with 
> /GR-; unpredictable behavior may result
> insighttoolkit-1.6.0\code\common\itkobjectfactory.h(51) : while 
> compiling class-template member function 'class itk::SmartPointer<class 
> fltk::VTKImageViewerBase> __cdecl itk::ObjectFactory<class 
> fltk::VTKImageViewerBase>::Create(void)'
> 
>  >>> error
> insighttoolkit-1.6.0\include\itklightobject.h(24) :
> fatal error C1083: Cannot open include file: 'iostream': No such file or 
> directory
> 
> for that error, i checked the include directories, and there is a MSVC++ 
> provided iostream file.
> I tried to link to the itk builded iostream file (itksys\iostream) but 
> couldn't resolve the problem this way either.
> 
> thanks in advance,
> 
> alex.
> 
> _______________________________________________
> 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