[Insight-users] Itk 3.6 weird compile problem

Luis Ibanez luis.ibanez at kitware.com
Tue Apr 15 09:30:40 EDT 2008


Hi Jeroen,


 > 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 ?



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


    Regards,


        Luis


---------------------------
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


More information about the Insight-users mailing list