[vtkusers] Problems linking a program with Vtk 5.0 on MacosX

Mike Jackson imikejackson at gmail.com
Mon Mar 26 10:33:19 EDT 2007


On Mar 25, 2007, at 5:19 PM, Roger Phillips wrote:

> Hello folks,
>
> currently I'm trying to link a program using Vtk 5.0, but I get  
> tons of undefined symbol errors:
>
>
>
> /usr/bin/g++   -I/Users/Heidegger/maftest2/Libraries/wxWin/Sources/ 
> utils/configtool/src/ -headerpad_max_install_names -fPIC  
> "CMakeFiles/exHistogram.dir/main.o" "CMakeFiles/exHistogram.dir/ 
> vtkHistogram.o"   -o exHistogram  -L/Users/Heidegger/maftest2/bin - 
> L/usr/local/lib -lmafVME -lmafOperations -lvtkCommon -lvtkRendering  
> -framework OpenGL -framework AGL -lvtkIO -lvtkGraphics - 
> lvtkFiltering -lvtksys -lvtkImaging -lvtkWidgets -lvtkexpat - 
> lvtkftgl -lvtkHybrid -lvtkVolumeRendering -lvtkGenericFiltering - 
> lvtkzlib -lvtkexoIIc -lvtkDICOMParser -lvtkfreetype -lvtkjpeg - 
> lvtkMPEG2Encode -lvtkNetCDF -lvtkpng -lvtktiff -framework Cocoa - 
> framework Carbon -framework AppKit
> /usr/bin/ld: Undefined symbols:
> vtkMapper2D::CollectRevisions(std::basic_ostream<char,  
> std::char_traits<char> >&)
> vtkMapper2D::PrintSelf(std::basic_ostream<char,  
> std::char_traits<char> >&, vtkIndent)
> vtkProcessObject::RemoveInput(vtkDataObject*)
> vtkProcessObject::SetNthInput(int, vtkDataObject*)
> vtkProcessObject::AddInput(vtkDataObject*)
> vtkAbstractMapper::GetScalars(vtkDataSet*, int, int, int, char  
> const*, int&)
> vtkAbstractMapper::ShallowCopy(vtkAbstractMapper*)
> vtkAbstractMapper::SetClippingPlanes(vtkPlaneCollection*)
> vtkAbstractMapper::vtkAbstractMapper()
> vtkAbstractMapper::~vtkAbstractMapper()
> typeinfo for vtkMapper2D
> vtable for vtkMapper2D
> vtkWindow::GetPosition()
> vtkWindow::SetPosition(int*)
> vtkWindow::SetPosition(int, int)
> vtkWindow::SetWindowName(char const*)
> vtkWindow::CollectRevisions(std::basic_ostream<char,  
> std::char_traits<char> >&)
> vtkWindow::GetSize()
> vtkWindow::SetSize(int*)
> vtkWindow::SetSize(int, int)
> vtkWindow::PrintSelf(std::basic_ostream<char,  
> std::char_traits<char> >&, vtkIndent)
> vtkWindow::vtkWindow()
> vtkWindow::~vtkWindow()
> typeinfo for vtkWindow
> vtkTimerLog::GetCurrentTime()
> vtkAbstractMapper::GetMTime()
> vtkPerspectiveTransform::SetupCamera(double const*, double const*,  
> double const*)
> vtkPerspectiveTransform::AdjustZBuffer(double, double, double, double)
> vtkPerspectiveTransform::New()
> vtkPerspectiveTransform::Ortho(double, double, double, double,  
> double, double)
> vtkPerspectiveTransform::Shear(double, double, double)
> vtkPerspectiveTransform::Stereo(double, double)
> vtkPerspectiveTransform::Frustum(double, double, double, double,  
> double, double)
> vtkCallbackCommand::vtkCallbackCommand()
> vtkMatrixToLinearTransform::New()
> vtkTimerLog::StartTimer()
> vtkTimerLog::MarkEndEvent(char const*)
> vtkTimerLog::GetElapsedTime()
> vtkTimerLog::MarkStartEvent(char const*)
> vtkTimerLog::StopTimer()
> vtkAbstractMapper::CollectRevisions(std::basic_ostream<char,  
> std::char_traits<char> >&)
> vtkAbstractMapper::PrintSelf(std::basic_ostream<char,  
> std::char_traits<char> >&, vtkIndent)
> __ZNSt8ios_base4InitC4Ev
> typeinfo for vtkAbstractMapper
> vtkAbstractMapper::AddConsumer(vtkObject*)
> vtkAbstractMapper::RemoveConsumer(vtkObject*)
> vtkProcessObject::CollectRevisions(std::basic_ostream<char,  
> std::char_traits<char> >&)
> vtkProcessObject::PrintSelf(std::basic_ostream<char,  
> std::char_traits<char> >&, vtkIndent)
> vtkProcessObject::vtkProcessObject()
> vtkProcessObject::~vtkProcessObject()
> typeinfo for vtkProcessObject
> vtkMultiThreader::SetSingleMethod(void* (*)(void*), void*)
> vtkMultiThreader::SingleMethodExecute()
> vtkMultiThreader::New()
> vtkTimerLog::GetCPUTime()
> vtkSource::UnRegister(vtkObjectBase*)
> vtkSource::UpdateData(vtkDataObject*)
> vtkSource::ExecuteData(vtkDataObject*)
> vtkSource::RemoveOutput(vtkDataObject*)
> vtkSource::SetNthOutput(int, vtkDataObject*)
> vtkSource::InRegisterLoop(vtkObject*)
> vtkSource::UpdateInformation()
> vtkSource::UpdateWholeExtent()
> vtkSource::ExecuteInformation()
> vtkSource::GetReleaseDataFlag()
> vtkSource::SetReleaseDataFlag(int)
> vtkSource::PropagateUpdateExtent(vtkDataObject*)
> vtkSource::ComputeInputUpdateExtents(vtkDataObject*)
> vtkSource::TriggerAsynchronousUpdate()
> vtkSource::AddOutput(vtkDataObject*)
> vtkSource::GetOutput(int)
> vtkProcessObject::UpdateProgress(double)
> vtkProcessObject::SetNumberOfInputs(int)
> vtkSource::Update()
> vtkSource::~vtkSource()
> vtkSource::CollectRevisions(std::basic_ostream<char,  
> std::char_traits<char> >&)
> vtkSource::PrintSelf(std::basic_ostream<char,  
> std::char_traits<char> >&, vtkIndent)
> vtkSource::vtkSource()
> typeinfo for vtkSource
> vtkSource::Execute()
> vtkImageIterator<char>::NextSpan()
> vtkImageIterator<char>::vtkImageIterator(vtkImageData*, int*)
> vtkImageIterator<double>::NextSpan()
> vtkImageIterator<double>::vtkImageIterator(vtkImageData*, int*)
> vtkImageIterator<float>::NextSpan()
> vtkImageIterator<float>::vtkImageIterator(vtkImageData*, int*)
> vtkImageIterator<unsigned char>::NextSpan()
> vtkImageIterator<unsigned char>::vtkImageIterator(vtkImageData*, int*)
> vtkImageIterator<int>::NextSpan()
> vtkImageIterator<int>::vtkImageIterator(vtkImageData*, int*)
> vtkImageIterator<unsigned int>::NextSpan()
> vtkImageIterator<unsigned int>::vtkImageIterator(vtkImageData*, int*)
> vtkImageIterator<long>::NextSpan()
> vtkImageIterator<long>::vtkImageIterator(vtkImageData*, int*)
> vtkImageIterator<unsigned long>::NextSpan()
> vtkImageIterator<unsigned long>::vtkImageIterator(vtkImageData*, int*)
> vtkImageIterator<short>::NextSpan()
> vtkImageIterator<short>::vtkImageIterator(vtkImageData*, int*)
> vtkImageIterator<unsigned short>::NextSpan()
> vtkImageIterator<unsigned short>::vtkImageIterator(vtkImageData*,  
> int*)
> vtkImageProgressIterator<char>::NextSpan()
> vtkImageProgressIterator<char>::vtkImageProgressIterator 
> (vtkImageData*, int*, vtkProcessObject*, int)
> vtkImageProgressIterator<double>::NextSpan()
> vtkImageProgressIterator<double>::vtkImageProgressIterator 
> (vtkImageData*, int*, vtkProcessObject*, int)
> vtkImageProgressIterator<float>::NextSpan()
> vtkImageProgressIterator<float>::vtkImageProgressIterator 
> (vtkImageData*, int*, vtkProcessObject*, int)
> vtkImageProgressIterator<unsigned char>::NextSpan()
> vtkImageProgressIterator<unsigned char>::vtkImageProgressIterator 
> (vtkImageData*, int*, vtkProcessObject*, int)
> vtkImageProgressIterator<int>::NextSpan()
> vtkImageProgressIterator<int>::vtkImageProgressIterator 
> (vtkImageData*, int*, vtkProcessObject*, int)
> vtkImageProgressIterator<unsigned int>::NextSpan()
> vtkImageProgressIterator<unsigned int>::vtkImageProgressIterator 
> (vtkImageData*, int*, vtkProcessObject*, int)
> vtkImageProgressIterator<long>::NextSpan()
> vtkImageProgressIterator<long>::vtkImageProgressIterator 
> (vtkImageData*, int*, vtkProcessObject*, int)
> vtkImageProgressIterator<unsigned long>::NextSpan()
> vtkImageProgressIterator<unsigned long>::vtkImageProgressIterator 
> (vtkImageData*, int*, vtkProcessObject*, int)
> vtkImageProgressIterator<short>::NextSpan()
> vtkImageProgressIterator<short>::vtkImageProgressIterator 
> (vtkImageData*, int*, vtkProcessObject*, int)
> vtkImageProgressIterator<unsigned short>::NextSpan()
> vtkImageProgressIterator<unsigned short>::vtkImageProgressIterator 
> (vtkImageData*, int*, vtkProcessObject*, int)
> vtkByteSwap::Swap2BERange(char*, int)
> vtkByteSwap::Swap4BERange(char*, int)
> vtkByteSwap::Swap8BERange(char*, int)
> vtkStructuredGrid::SetDimensions(int*)
> vtkStructuredGrid::SetPointVisibilityArray(vtkUnsignedCharArray*)
> vtkStructuredGrid::New()
> vtkRectilinearGrid::SetDimensions(int*)
> vtkRectilinearGrid::New()
> vtkStructuredPoints::New()
> vtkSource::UpdateExtentIsEmpty(vtkDataObject*)
> collect2: ld returned 1 exit status
>
>
>
>
> My MacOsX Version is 10.4.9, Gcc Compiler version is 4.0.1 .
>
> Any ideas what might be wrong?
>
> Thanks for your admittance
>
>

Couple of things to ask:
    Are you using Makefiles or Xcode for your project?
    Did you actually "Install" the vtk libs in /usr/local/lib? (sudo  
make install from the vtk build tree?)

It looks as though the compile process found the headers ok but not  
the libraries.

Basically, the linker is looking in the following locations for the  
vtk libraries:
-L/Users/Heidegger/maftest2/bin
-L/usr/local/lib
in addition to the default locations of /usr/lib.

You may want to make sure the vtk libraries are actually located in  
one of those locations.


-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services




More information about the vtkusers mailing list