[vtkusers] Building Cocoa example on OSX

Andy Somogyi andy.somogyi at gmail.com
Mon Mar 9 21:53:10 EDT 2015


Hi All, 

This question has been asked before, but I’ve not seen any resolution. 

I’m trying the build a Cocoa example on OSX 10.9, and I get the Undefined symbols for architecture x86_64:

"_OBJC_CLASS_$_vtkCocoaGLView", referenced from:
      _OBJC_CLASS_$_BasicVTKView in BasicVTKView.o
"_OBJC_METACLASS_$_vtkCocoaGLView", referenced from:
      _OBJC_METACLASS_$_BasicVTKView in BasicVTKView.o

This is trying to build agains VTK 6.1 from brew with Cocoa enabled, the libvtkRenderingOpenGL clearly has the symbols:

nm libvtkRenderingOpenGL-6.1.dylib  | grep _vtkCocoaGLView
0000000000167258 s _OBJC_CLASS_$_vtkCocoaGLView
0000000000167158 s _OBJC_IVAR_$_vtkCocoaGLView._myVTKRenderWindow
0000000000167150 s _OBJC_IVAR_$_vtkCocoaGLView._rolloverTrackingRectSet
0000000000167160 s _OBJC_IVAR_$_vtkCocoaGLView._rolloverTrackingRectTag
0000000000167280 s _OBJC_METACLASS_$_vtkCocoaGLView

I’ve tried moving the libvtkRenderOpenGL lib to the beginning, middle and end of the linker options, and no luck, here is the exact linker command Xcode is giving:

Ld /Users/andy/Library/Developer/Xcode/DerivedData/PdeTest-fthagvebqwkozjglphoryxejazbu/Build/Products/Debug/PdeTest.app/Contents/MacOS/PdeTest normal x86_64
    cd /Users/andy/src/PdeTest
    export MACOSX_DEPLOYMENT_TARGET=10.9
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -L/Users/andy/Library/Developer/Xcode/DerivedData/PdeTest-fthagvebqwkozjglphoryxejazbu/Build/Products/Debug -L/usr/local/lib -F/Users/andy/Library/Developer/Xcode/DerivedData/PdeTest-fthagvebqwkozjglphoryxejazbu/Build/Products/Debug -filelist /Users/andy/Library/Developer/Xcode/DerivedData/PdeTest-fthagvebqwkozjglphoryxejazbu/Build/Intermediates/PdeTest.build/Debug/PdeTest.build/Objects-normal/x86_64/PdeTest.LinkFileList -Xlinker -rpath -Xlinker @executable_path/../Frameworks -mmacosx-version-min=10.9 -stdlib=libc++ -fobjc-link-runtime -framework Cocoa -framework OpenGL -framework IOKit -lvtkCommonCore-6.1 -lvtkCommonDataModel-6.1 -lvtkCommonExecutionModel-6.1 -lvtkCommonMath-6.1 -lvtkCommonMisc-6.1 -lvtkCommonSystem-6.1 -lvtkCommonTransforms-6.1 -lvtkFiltersCore-6.1 -lvtkFiltersExtraction-6.1 -lvtkFiltersGeneral-6.1 -lvtkFiltersGeometry-6.1 -lvtkFiltersSources-6.1 -lvtkImagingCore-6.1 -lvtkImagingMorphological-6.1 -lvtkImagingStencil-6.1 -lvtkInteractionImage-6.1 -lvtkInteractionStyle-6.1 -lvtkIOCore-6.1 -lvtkIOGeometry-6.1 -lvtkIOImage-6.1 -lvtkIOXML-6.1 -lvtkIOXMLParser-6.1 -lvtkRenderingCore-6.1 -lvtkRenderingFreeType-6.1 -lvtkRenderingFreeTypeOpenGL-6.1 -lvtksys-6.1 -lvtkRenderingOpenGL-6.1 -Xlinker -dependency_info -Xlinker /Users/andy/Library/Developer/Xcode/DerivedData/PdeTest-fthagvebqwkozjglphoryxejazbu/Build/Intermediates/PdeTest.build/Debug/PdeTest.build/Objects-normal/x86_64/PdeTest_dependency_info.dat -o /Users/andy/Library/Developer/Xcode/DerivedData/PdeTest-fthagvebqwkozjglphoryxejazbu/Build/Products/Debug/PdeTest.app/Contents/MacOS/PdeTest

Everything else links perfectly find, except for these two symbols. 

Anybody have any ideas?

thanks


More information about the vtkusers mailing list