[Insight-users] Itk 3.6 weird compile problem : kwsys/ios and stl directories
Luis Ibanez
luis.ibanez at kitware.com
Tue Apr 15 21:44:06 EDT 2008
Hi Jeroen,
I think Dan's advice is probably the best way to go in your case.
That is, to take the list of include directories from another
CMake-configured ITK project.
----
Just to answer your previous questions regarding the directories
itksys/ios
itksys/stl
They have been in the configuration of Utilities/kwsys/CMakeLists.txt
for a while. See the CVS annotate of this file (lines 604-606):
http://www.itk.org/cgi-bin/viewcvs.cgi/Utilities/kwsys/CMakeLists.txt?annotate=1.137.2.1&root=Insight
What ITK release were you using before updating to ITK 3.6 ?
Apparently the creation of the itksys/ios and itksys/stl directories
was introduced in kwsys on December 23, 2003:
http://www.itk.org/cgi-bin/viewcvs.cgi/Utilities/kwsys/CMakeLists.txt?annotate=1.137.2.1&root=Insight
This would be as old as ITK 1.6...
-----
Regarding your second question:
When to use or not to use itksys ?
It is usually a good idea to use itksys. It provides a layer
of portable functionalities across a large number of platforms.
One thing that could help a lot is for us to install most headers in
the same directory. In this way, you could build ITK, and then install
it in a different directory. Currently we install ITK with a directory
structure that is almost a copy of the build directory. However, we
could flatten that structure and aggregate most header files in a
smaller set of directories. This is probably a worthwhile undertaking
for the release of ITK 3.8.
Please let us know about the release of ITK that you were using before.
Thanks
Luis
--------------------------
J.S.Wijnhout at lumc.nl wrote:
>>>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
>
>
More information about the Insight-users
mailing list