[Insight-users] ITK, VTK and QT

kavec at messi.uku.fi kavec at messi.uku.fi
Fri Dec 9 03:36:05 EST 2005


Hi,

Quoting DiLLa HaNdiNi <daffodilsky at gmail.com>:

> Dear All,
>
> I am a student trying to build a GUI to combine ITK, VTK and QT. I am
> using MSVC 6, SP6. I did not use CMake to configure the project, yet I used
> manual addition of library and header files in project settings.
> As I am still new in this, I started by trying the program in "Getting
> Started II" tutorial. In the QT GUI I make a button to execute this program.
> I managed to compile, link and run. Yet, when the button is clicked, it
> doesn't perform as expected. There is a run time error message appearing,
> and the program aborted.

You may have uninitialized pointer/variable causing you this pain.

> While compiling, there is no error, yet there are
> several warnings that I appended below.

C++ syntax of your code can be correct, yet it may still give you incorrect
results:

//Calculate area or a cicle
area = 2*PI*r;  //compiles, but wrong (or uninitialized)

> I have no idea of how to deal about this.
> I really need suggestions.

Try to set some runtime messages, i.e.

std::cout << "Doing A ....";
.
.
.
std::cout << "done!" << std::endl;
.
.
.
std::cout << "Doing B ....";
.
.
.
std::cout << "done!" << std::endl;

Hope this helps.

Martin

PS: try to resolve all the compilation warnings before continuing

> Thank you in advance.
>
> While compiling, there are several warnings as follows:
>
> --------------------Configuration: Regn - Win32 Debug--------------------
> UICing regndialog.ui...
> Performing Custom Build Step on .\vtkQtRenderWindowInteractor.h
> Performing Custom Build Step on .\regndialogimpl.h
> Compiling...
> main.cpp
> moc_regndialog.cpp
> moc_regndialogimpl.cpp
> moc_vtkQtRenderWindowInteractor.cpp
> regndialog.cpp
> c:\itksource\itksrc\itkbasic\code\common\itkeventobject.h(134) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with
> /GR-; unpredictable behavior may result
> c:\itksource\itksrc\itkbasic\code\common\itkeventobject.h(135) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with
> /GR-; unpredictable behavior may result
> c:\itksource\itksrc\itkbasic\code\common\itkeventobject.h(136) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with
> /GR-; unpredictable behavior may result
> c:\itksource\itksrc\itkbasic\code\common\itkeventobject.h(137) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with
> /GR-; unpredictable behavior may result
> c:\itksource\itksrc\itkbasic\code\common\itkeventobject.h(138) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with
> /GR-; unpredictable behavior may result
> c:\itksource\itksrc\itkbasic\code\common\itkeventobject.h(139) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with
> /GR-; unpredictable behavior may result
> c:\itksource\itksrc\itkbasic\code\common\itkeventobject.h(140) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with
> /GR-; unpredictable behavior may result
> c:\itksource\itksrc\itkbasic\code\common\itkeventobject.h(141) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with
> /GR-; unpredictable behavior may result
> c:\itksource\itksrc\itkbasic\code\common\itkeventobject.h(142) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with
> /GR-; unpredictable behavior may result
> c:\itksource\itksrc\itkbasic\code\common\itkeventobject.h(143) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with
> /GR-; unpredictable behavior may result
> c:\itksource\itksrc\itkbasic\code\common\itkeventobject.h(144) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with
> /GR-; unpredictable behavior may result
> c:\itksource\itksrc\itkbasic\code\common\itkeventobject.h(145) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with
> /GR-; unpredictable behavior may result
> c:\itksource\itksrc\itkbasic\code\common\itkeventobject.h(146) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with
> /GR-; unpredictable behavior may result
> c:\itksource\itksrc\itkbasic\code\common\itkeventobject.h(147) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with
> /GR-; unpredictable behavior may result
> c:\itksource\itksrc\itkbasic\code\common\itkeventobject.h(148) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with
> /GR-; unpredictable behavior may result
> c:\itksource\itksrc\itkbasic\code\common\itkeventobject.h(150) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::EventObject' with
> /GR-; unpredictable behavior may result
> c:\itksource\itksrc\itkbasic\code\common\itkobjectfactory.h(53) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::LightObject' with
> /GR-; unpredictable behavior may result
>         c:\itksource\itksrc\itkbasic\code\common\itkobjectfactory.h(51) :
> while compiling class-template member function 'class
> itk::SmartPointer<class itk::MutexLock> __cdecl itk::ObjectFactory<class
> itk::MutexLock>::Create(void)'
> c:\itksource\itksrc\itkbasic\code\common\itkobjectfactory.h(53) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::LightObject' with
> /GR-; unpredictable behavior may result
>         c:\itksource\itksrc\itkbasic\code\common\itkobjectfactory.h(51) :
> while compiling class-template member function 'class
> itk::SmartPointer<class itk::MultiThreader> __cdecl itk::ObjectFactory<class
> itk::MultiThreader>::Create(void)'
> c:\itksource\itksrc\itkbasic\code\common\itkobjectfactory.h(53) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::LightObject' with
> /GR-; unpredictable behavior may result
>         c:\itksource\itksrc\itkbasic\code\common\itkobjectfactory.h(51) :
> while compiling class-template member function 'class
> itk::SmartPointer<class itk::FastMutexLock> __cdecl itk::ObjectFactory<class
> itk::FastMutexLock>::Create(void)'
> c:\itksource\itksrc\itkbasic\code\common\itkobjectfactory.h(53) : warning
> C4541: 'dynamic_cast' used on polymorphic type 'class itk::LightObject' with
> /GR-; unpredictable behavior may result
>         c:\itksource\itksrc\itkbasic\code\common\itkobjectfactory.h(51) :
> while compiling class-template member function 'class
> itk::SmartPointer<class itk::LightProcessObject> __cdecl
> itk::ObjectFactory<class itk::LightProcessObject>::Create(void)'
> c:\program files\microsoft visual studio\vc98\include\vector(156) : warning
> C4018: '<' : signed/unsigned mismatch
>         c:\program files\microsoft visual studio\vc98\include\vector(156) :
> while compiling class-template member function 'void __thiscall
> std::vector<unsigned int,class std::allocator<unsigned int>
> >::insert(unsigned int *,unsigned int,const unsig
> ned int &)'
> c:\program files\microsoft visual studio\vc98\include\vector(167) : warning
> C4018: '<' : signed/unsigned mismatch
>         c:\program files\microsoft visual studio\vc98\include\vector(156) :
> while compiling class-template member function 'void __thiscall
> std::vector<unsigned int,class std::allocator<unsigned int>
> >::insert(unsigned int *,unsigned int,const unsig
> ned int &)'
> c:\program files\microsoft visual studio\vc98\include\vector(156) : warning
> C4018: '<' : signed/unsigned mismatch
>         c:\program files\microsoft visual studio\vc98\include\vector(156) :
> while compiling class-template member function 'void __thiscall
> std::vector<long,class std::allocator<long> >::insert(long *,unsigned
> int,const long &)'
> c:\program files\microsoft visual studio\vc98\include\vector(167) : warning
> C4018: '<' : signed/unsigned mismatch
>         c:\program files\microsoft visual studio\vc98\include\vector(156) :
> while compiling class-template member function 'void __thiscall
> std::vector<long,class std::allocator<long> >::insert(long *,unsigned
> int,const long &)'
> vtkQtRenderWindow.cpp
> vtkQtRenderWindowInteractor.cpp
> Generating Code...
> Linking...
>    Creating library Debug/Regn.lib and object Debug/Regn.exp
>
> Regn.exe - 0 error(s), 24 warning(s)
>




More information about the Insight-users mailing list