[vtkusers] VTK static link with Qt app on Mac OS X

Gib Bogle g.bogle at auckland.ac.nz
Mon Sep 27 02:11:53 EDT 2010


Almost there ... having got the linking of static VTK library with my Qt app 
(shared Qt libraries) working on Linux, I'm now trying to do the same thing on 
Mac OS X.  As before, I first got the shared VTK case working.  I then built the 
static VTK libraries, and added all those not already there to the LIBS list in 
Qt Creator, which now looks like this:

LIBS += -L/Users/mbog002/code/VTK-static/bin -lQVTK -lvtkRendering -lvtkGraphics 
  -lvtkIO \
-lvtkCommon -lvtkInfovis -lvtkViews -lvtkWidgets -lvtkHybrid -lvtkParallel 
-lvtkverdict \
-lvtkftgl -lvtkfreetype -lvtkNetCDF -lvtkmetaio -lvtksqlite -lvtkpng -lvtkzlib \
-lvtkjpeg -lvtktiff -lvtkexpat -lVPIC -lCosmo -lvtkexoIIc -lvtklibxml2 -lvtkalglib \
-lvtkVolumeRendering -lvtkFiltering -lvtkImaging -lvtksys -lvtkQtChart \
-lGL -lGLU -lglut

This generates a large number of "undefined symbol" link errors.  Here is a 
sample (sorry about the formatting):

Undefined symbols:
   "_HIViewGetViewForMouseEvent", referenced from:
       myWinEvtHndlr(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*)  in 
libvtkRendering.a(vtkCarbonRenderWindowInteractor.cxx.o)
   "_HIViewFindByID", referenced from:
       vtkCarbonRenderWindow::UpdateGLRegion()       in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
       vtkCarbonRenderWindow::CreateAWindow()       in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
   "_aglSetCurrentContext", referenced from:
       vtkCarbonRenderWindow::MakeCurrent()       in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
       vtkCarbonRenderWindow::MakeCurrent()       in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
       vtkCarbonRenderWindow::DestroyWindow()       in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
       vtkCarbonRenderWindow::CreateOffScreenWindow(int, int)in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
       vtkCarbonRenderWindow::CreateAWindow()       in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
   "_aglSetOffScreen", referenced from:
       vtkCarbonRenderWindow::CreateOffScreenWindow(int, int)in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
   "_GetWindowPort", referenced from:
       vtkCarbonRenderWindow::UpdateGLRegion()       in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
       vtkCarbonRenderWindow::CreateAWindow()       in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
   "_aglDisable", referenced from:
       vtkCarbonRenderWindow::UpdateGLRegion()       in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
   "_GetControlRegion", referenced from:
       vtkCarbonRenderWindow::UpdateGLRegion()       in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
       vtkCarbonRenderWindow::UpdateGLRegion()       in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
       vtkCarbonRenderWindow::UpdateGLRegion()       in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
       vtkCarbonRenderWindow::UpdateGLRegion()       in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
   "_HIViewConvertRect", referenced from:
       vtkCarbonRenderWindow::UpdateGLRegion()       in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
   "_aglChoosePixelFormat", referenced from:
       vtkCarbonRenderWindowInternal::ChoosePixelFormat(int, int, int, int, int, 
int, int)in libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
       vtkCarbonRenderWindowInternal::CreateContext(int, int&, int&, int&, int&, 
int&, char const*&)in libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
   "_MoveWindow", referenced from:
       vtkCarbonRenderWindow::SetPosition(int, int)in 
libvtkRendering.a(vtkCarbonRenderWindow.cxx.o)
   "_CGGetLastMouseDelta", referenced from:
       vtkCarbonLeaveCheck(__EventLoopTimer*, void*) in 
libvtkRendering.a(vtkCarbonRenderWindowInteractor.cxx.o)
       myWinEvtHndlr(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*)  in 
libvtkRendering.a(vtkCarbonRenderWindowInteractor.cxx.o)
   "___CFConstantStringClassReference", referenced from:
       cfstring=VRAM,totalsize in 
libvtkRendering.a(vtkCoreGraphicsGPUInfoList.cxx.o)

When I built the static VTK libraries I used exactly the same ccmake configure 
settings as for the shared libraries, except of course for BUILD_SHARED_LIBS. 
Is this the right thing to do? If the VTK build is OK I must be missing some 
libraries, but what?  Are these X11 functions?  Thanks in advance for suggestions.



More information about the vtkusers mailing list