[vtkusers] Fail to link with static/shared VTK 4 on Linux/FreeBSD (undefined reference to...)

Chih-Wei Chiu jwchiu at csie.nctu.edu.tw
Fri Apr 12 08:42:39 EDT 2002


Problem: "undefined reference to..."
Software versions: VTK 4.0, gcc 3.0.4
OS: RedHat Linux 6.2

I used to successfully compile and link a simple program using
vtkMarchingCubes on Windows 2000, with VC++ 6.0 and VTK 4.

But it can not be link with the static VTK 4 libraries on Linux (they
have been successfully built in /usr/local/lib/vtk). 

It seems tha a lot of people in this mailing list encoutered the same
problem also, but why there is no answer? (I've search the mailing list
archive, exhaustly)


Build log
=========

[jwchiu at cggmpc7 isosurface]$ make
g++ -L../../../polyobj/lib -L/usr/local/lib/vtk -o ../../bin/isosurface
/tmp/isosurface.o /tmp/Mesh.o /tmp/Volume.o   -lpolyobj -lvtkPatented
-lvtkCommon -lvtkGraphics -lvtkIO -lvtkFiltering -lvtkRendering
-lvtkImaging
/tmp/isosurface.o: In function `main':
/home/jwchiu/cvs/fluid/src/isosurface/isosurface.cpp:42: undefined
reference to `vtkVolume16Reader::New()    '
/home/jwchiu/cvs/fluid/src/isosurface/isosurface.cpp:43: undefined
reference to `vtkVolume16Reader::SetDataByteOrderToLittleEndian()    
'/home/jwchiu/cvs/fluid/src/isosurface/isosurface.cpp:48: undefined
reference to `vtkMarchingCubes::New()    '
/home/jwchiu/cvs/fluid/src/isosurface/isosurface.cpp:49: undefined
reference to `vtkStructuredPointsSource::GetOutput()    '
/home/jwchiu/cvs/fluid/src/isosurface/isosurface.cpp:49: undefined
reference to
`vtkStructuredPointsToPolyDataFilter::SetInput(vtkImageData*)     '
/home/jwchiu/cvs/fluid/src/isosurface/isosurface.cpp:52: undefined
reference to `vtkPolyDataMapper::New()    '
/home/jwchiu/cvs/fluid/src/isosurface/isosurface.cpp:53: undefined
reference to `vtkPolyDataSource::GetOutput()    '
/home/jwchiu/cvs/fluid/src/isosurface/isosurface.cpp:53: undefined
reference to `vtkPolyDataMapper::SetInput(vtkPolyData*)     '
/home/jwchiu/cvs/fluid/src/isosurface/isosurface.cpp:55: undefined
reference to `vtkActor::New()   '
/home/jwchiu/cvs/fluid/src/isosurface/isosurface.cpp:58: undefined
reference to `vtkRenderer::New()    '
/home/jwchiu/cvs/fluid/src/isosurface/isosurface.cpp:61: undefined
reference to `vtkRenderWindow::New()    '
/home/jwchiu/cvs/fluid/src/isosurface/isosurface.cpp:62: undefined
reference to `vtkRenderWindow::AddRenderer(vtkRenderer*)      '
/home/jwchiu/cvs/fluid/src/isosurface/isosurface.cpp:73: undefined
reference to `vtkOBJExporter::New()  
--
--
Chih-Wei Chiu <http://www.csie.nctu.edu.tw/~jwchiu>
Computer Graphics and Geometry Modeling Laboratory,
Computer Science and Information Engineering Department,
National Chiao-Tung University, Taiwan



More information about the vtkusers mailing list