[Insight-users] Itk 3.6 weird compile problem

Blezek, Daniel J., Ph.D. Blezek.Daniel at mayo.edu
Tue Apr 15 09:57:45 EDT 2008


Hi Jeroen,

In the past when I haven't wanted to or could not use CMake to build
with ITK, I usually end up running CMake once, and examining the
settings.  This generally gives enough guidance to setup my projects.
While I find CMake to be a great tool, it simply can't be everything to
everyone.

I would suggest you run CMakeSetup once, and examine the settings in the
Visual Studio solution.  Defines and include paths are a good place to
start looking for your issues.

Regards,
-dan

-----Original Message-----
From: insight-users-bounces at itk.org
[mailto:insight-users-bounces at itk.org] On Behalf Of J.S.Wijnhout at lumc.nl
Sent: Tuesday, April 15, 2008 8:38 AM
To: luis.ibanez at kitware.com
Cc: insight-users at itk.org
Subject: Re: [Insight-users] Itk 3.6 weird compile problem

>> P.S.: I forgot to mention that I'm not using CMake to compile my own 
>> projects.

>           Here is the root of the problem   :-)
> CMake takes care of setting up the include paths for you.
> Is there any particular reason why you are not using CMake ?

At our institute we have a script that checks-out the appropriate CVS
modules from our server (for example the ITK module that we have
comitted to our CVS server) and create a visual studio solution. This is
the main reason for not using CMake. Technically it would be possible to
integrate CMake in our environment, but for now that seems like a lot of
work.

>Thanks for the report and for the quick explanation on the source of 
>the problem.

Could you please elaborate on the use of itksys? When should I use this
and when shouldn't I?

best,
Jeroen

P.S.:
I managed to trigger an internal compiler error on line 4 here:

#include <itkImageSpatialObject.h>

template < typename CoordRepType, int Dim > double f ( const itk::Point
< CoordRepType, Dim > &_dummy ) {
  return 0.0;
}

int main ( int, char ** )
{
  return 0;
}

It wouldn't be fair to blame ITK for this, of course. Let's just say
that today is not a good day for me, compiling wise.



---------------------------
J.S.Wijnhout at lumc.nl wrote:
> After some more trying I found out that the error is related to the 
> cstddef file in Utilities/itksys. This file is included when an STL 
> header is included. It turned out that I did not have the 
> Utilities/itksys/ios and Utilities/itksys/stl folders in my included 
> path and consequently the wrong STL headers were picked. However the 
> code still doesn't compile, after including these folders
> 
> I got errors like:
> 
> e:\Projects\Test\Itk3\include\Common\itkMacro.h(524) : error C2653: 
> 'std' : is not a class or namespace name
> 
> e:\Projects\Test\Itk3\include\Common\itkMacro.h(525) : error C2504: 
> 'ostringstream' : base class undefined
> 
> So, it's getting worse. I finally decided not to include any itksys 
> folders and finally my code compiled.
> 
>  
> 
> Although happy that my code is compiling again, I'm a bit worried: Am
I 
> supposed to use itksys, or not? Should I also refrain from linking to 
> the itksys lib? Can I expect portability issues (assuming that this
was 
> the underlying reason for creating itksys)? And finally, why wasn't
this 
> an issue with ITK 3.4?
> 
>  
> 
> best,
> 
> Jeroen
> 
>  
> 
> P.S.: I forgot to mention that I'm not using CMake to compile my own 
> projects.
> 
>  
> 
>
------------------------------------------------------------------------
> 
> *From:* insight-users-bounces at itk.org 
> [mailto:insight-users-bounces at itk.org] *On Behalf Of
*J.S.Wijnhout at lumc.nl
> *Sent:* Tuesday, April 15, 2008 2:31 PM
> *To:* insight-users at itk.org
> *Subject:* [Insight-users] Itk 3.6 weird compile problem
> 
>  
> 
> Hi,
> 
>  
> 
> I downloaded ITK 3.6 this morning (before the official announcement
> btw.) and I'm having some troubles compiling the most basic program:
> 
> #include <itkPoint.h>
> 
>  
> 
> int main ( int, char ** )
> 
> {
> 
>   return 0;
> 
> }
> 
>  
> 
>  
> 
> I get the following errors (I've only printed the firs three):
> 
> C:\Program Files\Microsoft Visual Studio .NET
> 2003\Vc7\include\xutility(111) : error C2146: syntax error : missing
';' 
> before identifier 'difference_type'
> 
>         C:\Program Files\Microsoft Visual Studio .NET
> 2003\Vc7\include\xutility(115) : see reference to class template 
> instantiation 'std::iterator_traits<_Ty*>' being compiled
> 
> C:\Program Files\Microsoft Visual Studio .NET
> 2003\Vc7\include\xutility(111) : error C2501: 
> 'std::iterator_traits<_Ty*>::difference_type' : missing storage-class
or 
> type specifiers
> 
> C:\Program Files\Microsoft Visual Studio .NET
> 2003\Vc7\include\xutility(122) : error C2146: syntax error : missing
';' 
> before identifier 'difference_type'
> 
>  
> 
> I did not change anything in my compiler settings, although it seems 
> related to that, errors in the STL headers mostly are. Still I can't 
> seem to figure out what it wrong. For what it is worth, I can still 
> compile code that does not use ITK. I'm using Visual Studio 2003 SP1.
> Any pointers are most welcome.
> 
>  
> 
> best,
> 
> Jeroen
> 
> 
>
------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
_______________________________________________
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