[Insight-developers] VTK_USE_ANSI_STDLIB confusion

Robert Tamburo rjtst21 at pitt . edu
Tue, 27 May 2003 09:54:30 -0400


Thanks. I broke down and searched through all of the external dependencies.
I found a few includes of iostream.h in some ITK files. I'll upload the
changes once the purify information is generated.

Thanks again,
Rob

----- Original Message ----- 
From: "Bill Hoffman" <bill . hoffman at kitware . com>
To: "Robert Tamburo" <rjtst21 at pitt . edu>;
<insight-developers at public . kitware . com>
Sent: Tuesday, May 27, 2003 9:18 AM
Subject: Re: [Insight-developers] VTK_USE_ANSI_STDLIB confusion


> There must be one hiding in a header file.   The way to find
> it is to get the command line for the compiler (cl) that
> is being used.   You should be able to find it by showing
> the properties of the library or executable with the problem.
> Then cut and paste the project options to an editor.
> Then add cl /E (restof options) > file.cpp.
> This will create a preprocessed file.   Then look at file.cpp
> in an editor and figure out which file is including io.h.
>
> -Bill
>
>
> At 02:06 PM 5/24/2003, Robert Tamburo wrote:
> >I've removed all stream file includes and specified std::cout, std::endl,
> >etc. and the problem still exists. Any other ideas?
> >
> >----- Original Message ----- 
> >From: "Bill Hoffman" <bill . hoffman at kitware . com>
> >To: "Robert Tamburo" <rjtst21 at pitt . edu>;
> ><insight-developers at public . kitware . com>
> >Cc: "insight users" <insight-users at public . kitware . com>
> >Sent: Friday, May 23, 2003 2:58 PM
> >Subject: Re: [Insight-developers] VTK_USE_ANSI_STDLIB confusion
> >
> >
> >> You have to find the part of the code that is including an
> >> old stream file, something like <iostream.h>.    Then you can try
> >> to make that the last include, or change it.
> >>
> >> -Bill
> >>
> >>
> >> At 02:46 PM 5/23/2003, Robert Tamburo wrote:
> >> >Our application is built on ITK/VTK/FLTK. Everything was fine until
VTK
> >was
> >> >built with VTK_USE_ANSI_STDLIB set to "ON".
> >> >
> >> >Here's a small sample of the errors:
> >> >C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\strstream(51) :
> >error
> >> >C2039: 'seekdir' : is not a member of 'ios'
> >> >        C:\Program Files\Microsoft Visual
Studio\VC98\INCLUDE\ios.h(106)
> >:
> >> >see declaration of 'ios'
> >> >C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\strstream(51) :
> >error
> >> >C2061: syntax error : identifier 'seekdir'
> >> >C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\strstream(54) :
> >error
> >> >C2039: 'openmode' : is not a member of 'ios'
> >> >        C:\Program Files\Microsoft Visual
Studio\VC98\INCLUDE\ios.h(106)
> >:
> >> >see declaration of 'ios'
> >> >D:\VTK\Common\vtkIOStream.h(44) : error C2874: using-declaration
causes a
> >> >multiple declaration of 'cerr'
> >> >        C:\Program Files\Microsoft Visual
> >Studio\VC98\INCLUDE\iostream(19) :
> >> >see declaration of 'cerr'
> >> >D:\VTK\Common\vtkIOStream.h(45) : error C2874: using-declaration
causes a
> >> >multiple declaration of 'cout'
> >> >        C:\Program Files\Microsoft Visual
> >Studio\VC98\INCLUDE\iostream(18) :
> >> >see declaration of 'cout'
> >> >C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(104) :
error
> >> >C2371: 'ostream' : redefinition; different basic types
> >> >        C:\Program Files\Microsoft Visual
Studio\VC98\INCLUDE\iosfwd(257)
> >:
> >> >see declaration of 'ostream'
> >> >C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ios.h(106) :
error
> >> >C2371: 'ios' : redefinition; different basic types
> >> >        C:\Program Files\Microsoft Visual
Studio\VC98\INCLUDE\iosfwd(254)
> >:
> >> >see declaration of 'ios'
> >> >
> >> >I'm confused for several reasons. First of course being that ITK is
not
> >> >supposed to build with
> >> >VTK_USE_ANSI_STDLIB  to "ON" as testified in:
> >>
>
>>http://www . itk . org/cgi-bin/InsightFAQ/InsightFAQ?query=ansi&querytype=simp
l
> >e&casefold=yes&req=search
> >> >http://www . itk . org/pipermail/insight-users/2003-April/003313 . html
> >>
>http://public . kitware . com/pipermail/insight-users/2002-March/000192 . html)
> >> >....but I have no problems building ITK or our app with this flag set
to
> >> >"OFF"
> >> >
> >> >As per the suggestions in the FAQ:
> >> >"If the compile/link error is in an application that is trying to use
> >ITK,
> >> >the solution is usually to include an ITK header file before any other
> >> >include file. This forces whatever include files that the application
may
> >> >use to use the Standard Library streams library. "
> >>
>
>>http://www . itk . org/cgi-bin/InsightFAQ/InsightFAQ?query=ostream&querytype=s
i
> >mple&casefold=yes&req=search
> >> >.........I moved all ITK includes before any other include files and
the
> >> >problem still persists.
> >> >
> >> >Any help in understanding this behavior would be greatly appreciated.
> >> >
> >> >-Rob
> >> >
> >> >_______________________________________________
> >> >Insight-developers mailing list
> >> >Insight-developers at public . kitware . com
> >> >http://public . kitware . com/mailman/listinfo/insight-developers
> >>
> >>
> >>
> >> _______________________________________________
> >> Insight-developers mailing list
> >> Insight-developers at public . kitware . com
> >> http://public . kitware . com/mailman/listinfo/insight-developers
> >>
> >
> >_______________________________________________
> >Insight-developers mailing list
> >Insight-developers at public . kitware . com
> >http://public . kitware . com/mailman/listinfo/insight-developers
>
>
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at public . kitware . com
> http://public . kitware . com/mailman/listinfo/insight-developers
>