[vtkusers] static libs...

fred fredmfp at gmail.com
Tue Oct 17 15:36:52 EDT 2006


I need to use VTK libs in static (so I rebuilt VTK with them).

I have no problem with shared libs:

gcc -Wall vtktest.c -lvtkIO -o vtktest"

works fine, no warning, no error message.

But with -static:

gcc -Wall -static vtktest.c -lvtkIO -o vtktest"

I have a lot of error messages:

/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/libvtkIO.a(vtkXMLWriterC.o):
In function `__static
_initialization_and_destruction_0(int, int)':
vtkXMLWriterC.cxx:(.text+0x23): undefined reference to
`std::ios_base::Init::Init()'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/libvtkIO.a(vtkXMLWriterC.o):
In function `__tcf_0'
:
vtkXMLWriterC.cxx:(.text+0x6c): undefined reference to
`std::ios_base::Init::~Init()'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/libvtkIO.a(vtkXMLWriterC.o):
In function `vtkXMLWr
iterC_SetNumberOfTimeSteps':
vtkXMLWriterC.cxx:(.text+0xbf): undefined reference to
`vtkObject::GetGlobalWarningDisplay()'
vtkXMLWriterC.cxx:(.text+0xe2): undefined reference to
`vtkOStrStreamWrapper::vtkOStrStreamWrapper()
'
vtkXMLWriterC.cxx:(.text+0xf5): undefined reference to
`vtkOStreamWrapper::operator<<(char const*)'
vtkXMLWriterC.cxx:(.text+0x105): undefined reference to
`vtkOStreamWrapper::operator<<(int)'
vtkXMLWriterC.cxx:(.text+0x115): undefined reference to
`vtkOStreamWrapper::operator<<(char const*)'
vtkXMLWriterC.cxx:(.text+0x125): undefined reference to
`vtkOStreamWrapper::operator<<(char const*)'
vtkXMLWriterC.cxx:(.text+0x130): undefined reference to
`vtkOStrStreamWrapper::str()'
vtkXMLWriterC.cxx:(.text+0x138): undefined reference to
`vtkOutputWindowDisplayGenericWarningText(ch
ar const*)'
vtkXMLWriterC.cxx:(.text+0x143): undefined reference to
`vtkOStrStreamWrapper::rdbuf()'
vtkXMLWriterC.cxx:(.text+0x153): undefined reference to
`vtkOStrStreamWrapper::freeze(int)'
vtkXMLWriterC.cxx:(.text+0x15e): undefined reference to
`vtkOStrStreamWrapper::~vtkOStrStreamWrapper
()'
vtkXMLWriterC.cxx:(.text+0x171): undefined reference to
`vtkOStrStreamWrapper::~vtkOStrStreamWrapper
()'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/libvtkIO.a(vtkXMLWriterC.o):
In function `vtkXMLWr
iterC_SetFileName':
vtkXMLWriterC.cxx:(.text+0x1d7): undefined reference to
`vtkObject::GetGlobalWarningDisplay()'
vtkXMLWriterC.cxx:(.text+0x1fa): undefined reference to
`vtkOStrStreamWrapper::vtkOStrStreamWrapper(
)'
vtkXMLWriterC.cxx:(.text+0x20d): undefined reference to
`vtkOStreamWrapper::operator<<(char const*)'
vtkXMLWriterC.cxx:(.text+0x21d): undefined reference to
`vtkOStreamWrapper::operator<<(int)'

and so on.

What am I doing wrong ?

PS : I'm running on Debian Etch.

Cheers,

-- 
http://scipy.org/FredericPetit




More information about the vtkusers mailing list