[vtkusers] vtk and tcl ambiguous symbols

Brad King brad.king at kitware.com
Mon Apr 26 09:41:42 EDT 2004


Hans Fraaije wrote:
> Hello
> 
> I am writing a C++ library (mylib), to be accessible with a script (tcl,
> python, perl). I generate the wrapper my_lib_wrap.cxx with SWIG. This works
> fine.
> 
> For the graphics part of the library I would like to use vtk, so that the
> script calls a my_function from my_library, with in term uses the vtk
> classes. I am using Microsoft Visual Studio 6 under XP for development.
> 
> In the version I have now, I can get either tcl + mylib swigged, compiled,
> linked and executed, or vtk + mylib (without tcl) compiled, linked and
> executed, but when I include vtk in a working tcl+mylib program, I get a lot
> of errors.
> 
> The compiler complains about ambiguous symbols, all have to do with IO high
> up in VC98 include files:
> for example
>  'streambuf' ambiguous symbol ( in VC98\include\ios.h)
> 'streampos' ambigous symbol (in VC98\include\streamb.h)
> 'streamoff' ambigous symbol (in VC98\include\streamb.h)
> 'ios' ambigous symbol (in VC98\include\ios.h)
> 
> I think that vtk also uses these symbols, somewhere, but I am puzzled why
> the interference with tcl
> 
> I use vtk42 (and tcl83)
> library modules
> (microsoft.libs) ... opengl32.lib glu32.lib vtkRendering.lib vtkGraphics.lib
> vtkImaging.lib vtkFiltering.lib vtkCommon.lib vtkftgl.lib vtkfreetype.lib
> tcl83.lib
> 
> Is there a way to avoid the ambiguity? Why do tcl and vtk bite? (I am NOT
> using the tclwrapper library from vtk, just vtkRendering.lib etc.)

When VTK was built, what was your setting for VTK_USE_ANSI_STDLIB in the 
CMake cache?  If you obtained the pre-compiled binaries, then it was 
probably OFF.  You can find the setting in vtkConfigure.h.

I suspect that your C++ code uses the ANSI streams library (iostream 
instead of iostream.h).  In order to link to VTK, it must also have used 
ANSI streams, so VTK_USE_ANSI_STDLIB should be set to ON.

-Brad



More information about the vtkusers mailing list