[vtkusers] Re: compiling errors with vtk32
Jean_Luc_Bordessoule at veritasdgc.co.uk
Jean_Luc_Bordessoule at veritasdgc.co.uk
Thu Jan 10 12:19:14 EST 2002
Hi zhangzhijun,
I had a similar problem.
The problem was the inclusion of BOTH 'iostream.h' and 'iostream'.
In Vtk, these files are included by 'vtkSystemIncludes.h' :
/* first include the local configuration for this machine */
#include "vtkConfigure.h"
....
// Handle changes for ANSI C++
---------------------------------------------
#ifdef VTK_USE_ANSI_STDLIB
#include <iostream>
.....
// otherwise, non-ANSI
-----------------------------------------------------
#else
#include <iostream.h>
......
In "vtkConfigure.h" , VTK_USE_ANSI_STDLIB can be defined or undefined.
So the problem becomes the definition of 'VTK_USE_ANSI_STDLIB'
The value of VTK_USE_ANSI_STDLIB is stored in 'vtkConfigure.h' after
running 'CMakeSetup.exe'
On my machine, VTK_USE_ANSI_STDLIB could be defined / undefined in 3
places:
D:\Vtk40\include\Vtk\vtkConfigure.h
D:\Vtk40\lib\vtkConfigure.h
In Visual C++ : Project / Settings ... / C++ / Preprocessor /
Preprocessor Definitions .
So make sure: how VTK_USE_ANSI_STDLIB is defined
In Visual C++ : Project / Settings ... / C++ / Preprocessor /
Preprocessor Definitions .
In Visual C++ : check the library path ( 'Tools \ Options \ Directories
\ Library Files ' ) and make sure the correct 'vtkConfigure.h' is
included.
>--- Message from "zhangzhijun" <zjzhang at ee.cuhk.edu.hk> on Thu, 10 Jan
2002 23:47:24 +0800 -----
>To: <vtkusers at public.kitware.com>
>Sub [vtkusers] compiling errors
t: with vtk32
>Dear all:
> I have a program which was written with vtk32. and when the
program compiles in window98,
>with the library which compile with the use Ansi c++ checked, there will
be this kind of error:
>--------------------Configuration: regist - Win32
Debug--------------------
>Compiling...
>nonrigid2.cpp
>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;
More information about the vtkusers
mailing list