[vtkusers] 'Undefined Reference' while compiling?

Bert VanSesamstraat bertvansesamstraat at hotmail.com
Wed Aug 28 08:41:23 EDT 2002


Dear all,
I wanted to try out the c++ examples shipped with vtk.
Therefore I used the following script:

VTK_PATH=/usr/include/vtk
VTK_PATH_LIB=/usr/lib/vtk/tcl

g++ -I$VTK_PATH -I$VTK_PATH/Common -I$VTK_PATH/Filtering \
-I$VTK_PATH/Graphics -I$VTK_PATH/Hybrid -I$VTK_PATH/IO \
-I/usr/X11R6/LessTif/Motif1.2/include -I$VTK_PATH/Imaging 
-I$VTK_PATH/Patented \
-I$VTK_PATH/Rendering -I/usr/X11R6/include/X11 \
-L$VTK_PATH_LIB -I$VTK_PATH_LIB/vtkcommon -I$VTK_PATH_LIB/lvtkfiltering 
-I$VTK_PATH_LIB/vtkgraphics \
-I$VTK_PATH_LIB/vtkhybrid -I$VTK_PATH_LIB/vtkiO -I$VTK_PATH_LIB/vtkimaging 
-I$VTK_PATH_LIB/vtkpatented -I$VTK_PATH_LIB/vtkrendering \
cpp/Example1.cxx -o Example1 -O2 -g

When I execute this script i run into a lot of 'undefined references'.

:
/tmp/ccu4psd8.o: In function `main':
/Net/work/home/maurice/tmp/cpp/Example1.cxx:44: undefined reference to 
`vtkRenderWindow::New(void)'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:45: undefined reference to 
`vtkRenderer::New(void)'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:46: undefined reference to 
`vtkRenderWindow::AddRenderer(vtkRenderer *)'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:48: undefined reference to 
`vtkSphereSource::New(void)'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:49: undefined reference to 
`vtkPolyDataMapper::New(void)'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:50: undefined reference to 
`vtkPolyDataSource::GetOutput(void)'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:50: undefined reference to 
`vtkPolyDataMapper::SetInput(vtkPolyData *)'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:51: undefined reference to 
`vtkActor::New(void)'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:53: undefined reference to 
`vtkConeSource::New(void)'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:54: undefined reference to 
`vtkGlyph3D::New(void)'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:55: undefined reference to 
`vtkPolyDataSource::GetOutput(void)'
/tmp/ccu4psd8.o: In function `main':
/usr/include/vtk/vtkGlyph3D.h:113: undefined reference to 
`vtkPolyDataSource::GetOutput(void)'
/usr/include/vtk/vtkGlyph3D.h:113: undefined reference to 
`vtkGlyph3D::SetSource(int, vtkPolyData *)'
/tmp/ccu4psd8.o: In function `main':
/Net/work/home/maurice/tmp/cpp/Example1.cxx:60: undefined reference to 
`vtkPolyDataMapper::New(void)'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:61: undefined reference to 
`vtkPolyDataSource::GetOutput(void)'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:61: undefined reference to 
`vtkPolyDataMapper::SetInput(vtkPolyData *)'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:62: undefined reference to 
`vtkActor::New(void)'
/tmp/ccu4psd8.o: In function `main':
/usr/include/vtk/vtkRenderer.h:69: undefined reference to 
`vtkViewport::AddProp(vtkProp *)'
/usr/include/vtk/vtkRenderer.h:69: undefined reference to 
`vtkViewport::AddProp(vtkProp *)'
/tmp/ccu4psd8.o: In function `main':
/Net/work/home/maurice/tmp/cpp/Example1.cxx:70: undefined reference to 
`XtSetLanguageProc'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:72: undefined reference to 
`XtVaAppInitialize'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:75: undefined reference to 
`XtDisplay'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:80: undefined reference to 
`vtkXRenderWindowInteractor::New(void)'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:81: undefined reference to 
`vtkRenderWindowInteractor::SetRenderWindow(vtkRenderWindow *)'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:88: undefined reference to 
`XtStrings'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:88: undefined reference to 
`XtStrings'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:88: undefined reference to 
`xmPushButtonWidgetClass'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:88: undefined reference to 
`XtVaCreateManagedWidget'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:90: undefined reference to 
`XtRealizeWidget'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:91: undefined reference to 
`_XmStrings'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:91: undefined reference to 
`XtAddCallback'
/Net/work/home/maurice/tmp/cpp/Example1.cxx:92: undefined reference to 
`XtAppMainLoop'
collect2: ld returned 1 exit status



Can someone tell me what I'm doing wrong?



_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com




More information about the vtkusers mailing list