[vtkusers] build vtk with ANSI STDLIB collision probs

William A. Hoffman billlist at nycap.rr.com
Thu Aug 1 09:58:01 EDT 2002


The problem is in the vli.h header files.   They #include the old style stream
classes.   You can remove the #include from the vli.h file, and remove the
friend functions that use ostream, and it should work.   

So, remove these lines from vli.h:
#include <iostream.h>

VLIEXPORT friend ostream & operator << ( ostream &, const VLIVector2D & );
VLIEXPORT friend ostream & operator << ( ostream &, const VLIVector3D & );
VLIEXPORT friend ostream & operator << ( ostream &, const VLIMatrix & );



-Bill


At 09:41 AM 8/1/2002 -0400, anast.jm at pg.com wrote:

>One of the Insight examples requires a vtk build with VTK_USE_ANSI_STDLIB
>turned on. When I try to build this way (7/30 CVS update, release build WinNT VC
>6.0) I get some library collisions that the VC compiler complains about. These
>are associated with
>vtkOpenGLVolumeProVG500Mapper.cxx
>vtkVolumeProMapper.cxx and
>vtkRenderingInstantiator7.cxx
>
>The errors are below (sorry for the length). Does anyone know how to cure this?? The build goes smoothly with no problems running vtk with this option turned
>off.
>Thanks, john
>
>
>=======================================
>vtkOpenGLVolumeProVG500Mapper.cxx
>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'
>C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(64) : error C2371: 'istream' : redefinition; different basic types
>        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(256) : see declaration of 'istream'
>C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(173) : error C2371: 'cin' : redefinition; different basic types
>        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iostream(17) : see declaration of 'cin'
>C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(139) : error C2371: 'cout' : redefinition; different basic types
>        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iostream(18) : see declaration of 'cout'
>C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(140) : error C2371: 'cerr' : redefinition; different basic types
>        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iostream(19) : see declaration of 'cerr'
>
>====================================
>vtkVolumeProMapper.cxx
>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'
>C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(64) : error C2371: 'istream' : redefinition; different basic types
>        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(256) : see declaration of 'istream'
>C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(173) : error C2371: 'cin' : redefinition; different basic types
>        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iostream(17) : see declaration of 'cin'
>C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(139) : error C2371: 'cout' : redefinition; different basic types
>        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iostream(18) : see declaration of 'cout'
>C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(140) : error C2371: 'cerr' : redefinition; different basic types
>        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iostream(19) : see declaration of 'cerr'
>P:\WinCVS\vtk40\VTK\Rendering\vtkVolumeProMapper.cxx(35) : error C2511: 'CollectRevisions' : overloaded member function 'void (class ostream &)' not found in
>'vtkVolumeProMapper'
>        P:\WinCVS\vtk40\VTK\Rendering\vtkVolumeProMapper.h(86) : see declaration of 'vtkVolumeProMapper'
>P:\WinCVS\vtk40\VTK\Rendering\vtkVolumeProMapper.cxx(198) : error C2511: 'PrintSelf' : overloaded member function 'void (class ostream &,class vtkIndent)' not
>found in 'vtkVolumeProMapper'
>        P:\WinCVS\vtk40\VTK\Rendering\vtkVolumeProMapper.h(86) : see declaration of 'vtkVolumeProMapper'
>vtkVolumeProVG500Mapper.cxx
>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'
>C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(64) : error C2371: 'istream' : redefinition; different basic types
>        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(256) : see declaration of 'istream'
>C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(173) : error C2371: 'cin' : redefinition; different basic types
>        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iostream(17) : see declaration of 'cin'
>C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(139) : error C2371: 'cout' : redefinition; different basic types
>        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iostream(18) : see declaration of 'cout'
>C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(140) : error C2371: 'cerr' : redefinition; different basic types
>        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iostream(19) : see declaration of 'cerr'
>P:\WinCVS\vtk40\VTK\Rendering\vtkVolumeProVG500Mapper.cxx(33) : error C2664: 'CollectRevisions' : cannot convert parameter 1 from 'class ostream' to 'class
>std::basic_ostream<char,struct std::char_traits<char> > &'
>        A reference that is not to 'const' cannot be bound to a non-lvalue
>
>==========================================
>vtkRenderingInstantiator7.cxx
>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'
>C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(64) : error C2371: 'istream' : redefinition; different basic types
>        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(256) : see declaration of 'istream'
>C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\istream.h(173) : error C2371: 'cin' : redefinition; different basic types
>        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iostream(17) : see declaration of 'cin'
>C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(139) : error C2371: 'cout' : redefinition; different basic types
>        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iostream(18) : see declaration of 'cout'
>C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ostream.h(140) : error C2371: 'cerr' : redefinition; different basic types
>        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iostream(19) : see declaration of 'cerr'
>
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers 




More information about the vtkusers mailing list