[Insight-users] Problems when building ITK based applications in a Visual C++6 environment

Henry Joye henryjoye at yahoo.com
Mon Sep 27 05:49:56 EDT 2004


Hi, Luis,

Thank you very much for your reply.

As you pointed out, I also want to use CMake to build
the project. But my problem is that I just add a
segmentation module into my existing Inventor based
visualization project. I didnot create a new ITK based
project from beginning. The existing project is a
little large and includes a lot of files and folders.
So I think it is an easy way to add ITK based
segmentation module directly into the existing VC++
project, but not using CMake. 

My problem is whether it is possible to automatically
convert existing VC++ project file to CMake's
CMakeLists.txt files or how to convert the existing
VC++ project file to CMake's CMakelists.tet files. 

I have added /GR compiler option to the project and
the previous warnings disappear. But other problems
appear. I add some including paths as the project
required step by step, e.g.
\INSIGHTTOOLKIT18\UTILITIES\VXL\CORE,\INSIGHTTOOLKIT18\UTILITIES\VXL\VCL,
\ITKBIN\UTILITIES\VXL\CORE, \ITKBIN\UTILITIES\VXL\VCL.
When building the project, the following errors appear
for each file related to ITK:

e:\insighttoolkit18\utilities\vxl\vcl\win32-vc60\vcl_cmath.h(85)
: error C2589: '(' : illegal token on right side of
'::'
e:\insighttoolkit18\utilities\vxl\vcl\win32-vc60\vcl_cmath.h(85)
: error C2059: syntax error : '::'
e:\insighttoolkit18\utilities\vxl\vcl\win32-vc60\vcl_cmath.h(89)
: error C2589: '(' : illegal token on right side of
'::'
e:\insighttoolkit18\utilities\vxl\vcl\win32-vc60\vcl_cmath.h(89)
: error C2059: syntax error : '::'
e:\insighttoolkit18\utilities\vxl\vcl\win32-vc60\vcl_cmath.h(93)
: error C2589: '(' : illegal token on right side of
'::'
e:\insighttoolkit18\utilities\vxl\vcl\win32-vc60\vcl_cmath.h(93)
: error C2059: syntax error : '::'
.............
d:\itk\insighttoolkit\code\common\itkconceptchecking.h(318)
: error C2653: 'Detail' : is not a class or namespace
name
       
e:\insighttoolkit18\code\common\itkconceptchecking.h(328)
: see reference to class template instantiation
'Signed<T>' being compiled
e:\insighttoolkit18\code\common\itkconceptchecking.h(318)
: error C2143: syntax error : missing ';' before '<'
       
e:\insighttoolkit18\code\common\itkconceptchecking.h(328)
: see reference to class template instantiation
'Signed<T>' being compiled
e:\insighttoolkit18\code\common\itkconceptchecking.h(318)
: error C2059: syntax error : '<'
       
e:\insighttoolkit18\code\common\itkconceptchecking.h(328)
: see reference to class template instantiation
'Signed<T>' being compiled
e:\insighttoolkit18\code\common\itkconceptchecking.h(318)
: error C2238: unexpected token(s) preceding ';'
       
e:\insighttoolkit18\code\common\itkconceptchecking.h(328)
: see reference to class template instantiation
'Signed<T>' being compiled
..................

Would you please tell me how to solve these problems?

Thanks a lot for your help.

Joye









> 
> Your life will be much simpler if you use CMake...
> 
> but if you insist in configuring your project in the
> hard way, then you must enable the use of
> Exceptions.
> 
>      You do this by adding /GR compiler option.
> 
> Please check on the compiler options of your project
> and enable exceptions.
> 
> If you were using CMake, it will take care of this
> annoying little details, and you would be doing
> image
> processing instead of tweaking compiler options.
> 
> 
> 
>    Regards,
> 
> 
>      Luis
> 
> 
> 
> ------------------
> Henry Joye wrote:
> > Hi, all,
> > 
> > I am using ITK in an OpenInventor based project on
> > Windows Xp and build it in Visual C++ 6. I donot
> use
> > CMake in my project. In order to build the
> project, I
> > set the include path of ITK in Visual C++ 6
> through
> >
��Tools��-->��Options��-->��Directories��.
Because
> > there is no separate specific folder of
> ��Include�� in
> > ITK, I add
> ��\Insight\InsightToolkit18\Code\Common��,
> >
��\Insight\InsightToolkit18\Code\Algorithms��,
and
> ITK
> > binary folder ��ITKBin�� into the include
path
> > environment. When I build the project, the project
> ask
> > for the path of ��VCL��, I also add
> > ��\INSIGHTTOOLKIT18\UTILITIES\VXL\VCL��
into the
> > include path. After these steps, I begin to build
> the
> > project and receive following errors and warnings
> > (there are several this kind of warning for every
> ITK
> > related project file):
> > 
> >
>
e:\insighttoolkit18\code\common\itkeventobject.h(134)
> > : warning C4541: 'dynamic_cast' used on
> polymorphic
> > type 'class itk::EventObject' with /GR-;
> unpredictable
> > behavior may result
> >
>
e:\insighttoolkit18\code\common\itkeventobject.h(135)
> > : warning C4541: 'dynamic_cast' used on 
> > ����������
> >
>
e:\insighttoolkit18\code\common\itkeventobject.h(138)
> > : warning C4541: 'dynamic_cast' used on
> polymorphic
> > type 'class itk::EventObject' with /GR-;
> unpredictable
> > behavior may result
> >
>
e:\insighttoolkit18\code\common\itkeventobject.h(139)
> > : warning C4541: 'dynamic_cast' used on
> polymorphic
> > type 'class itk::EventObject' with /GR-;
> unpredictable
> > behavior may result
> > ������������
> >
>
e:\insighttoolkit18\utilities\vxl\vcl\vcl_compiler.h(134)
> > : fatal error C1083: Cannot open include file:
> > 'vcl_config_manual.h': No such file or directory
> > 
> > My questions are:
> > 1)	What causes these warnings and errors?
> > 2)	How to build a ITK based project in Visual C++
> 6
> > without using CMake?
> > 3)	Is it possible to create a separate
��Include��
> > folder to be used during building applications?
> > 4)	How to solve these problems?
> > 
> > Thanks in advance!
> > 



		
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail


More information about the Insight-users mailing list