[vtkusers] Problem compiling VTK based applications on OS X Lion with Xcode 4.3.3

Stuart Barnes stuartbarnes99 at gmail.com
Fri Jun 22 05:49:42 EDT 2012


Hi
I have managed to successfully compile and install VTK 5.10 on my Mac (Lion 10.7.4) according to the instructions at http://www.vtk.org/Wiki/Cocoa_VTK without any issues and I can successfully execute a random selection of the example applications. However, when I try to compile any application in XCode (4.3.3), I get a series of compile time errors. For example, if I try to compile the SimpleCocoaVTK example project from the git repository at vtk.org I get the following output at compile time (I've only included the first part of the output, as it is quite large):

********* Start output ***********
Build target SimpleCocoaVTK

CompileC /Users/stubbler/Library/Developer/Xcode/DerivedData/SimpleCocoaVTK-gbtxjsaivazkvcfrgcddlupyumoy/Build/Intermediates/SimpleCocoaVTK.build/Debug/SimpleCocoaVTK.build/Objects-normal/i386/MyDocument.o MyDocument.mm normal i386 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/stubbler/develop/Graphics/VTK/VTK-f52fb8d
    setenv LANG en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -arch i386 -fmessage-length=0 -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-implicit-atomic-properties -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -Wno-arc-abi -Wc++11-extensions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -fasm-blocks -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.5 -g -fvisibility=hidden -fvisibility-inlines-hidden -Wno-conversion -Wno-sign-conversion "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -I/Users/stubbler/Library/Developer/Xcode/DerivedData/SimpleCocoaVTK-gbtxjsaivazkvcfrgcddlupyumoy/Build/Intermediates/SimpleCocoaVTK.build/Debug/SimpleCocoaVTK.build/SimpleCocoaVTK.hmap -I/Users/stubbler/Library/Developer/Xcode/DerivedData/SimpleCocoaVTK-gbtxjsaivazkvcfrgcddlupyumoy/Build/Products/Debug/include -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10 -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/alglib -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/internal -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/LSDyna -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/mrmpi -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkexpat -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkfreetype -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkhdf5 -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkjpeg -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtklibproj4 -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtklibxml2 -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkmetaio -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtknetcdf -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkpng -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtksqlite -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkstd -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtksys -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtktiff -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkzlib -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkfreetype/include -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtklibxml2/libxml -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtknetcdf/include -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtksys/ios -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtksys/stl -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkfreetype/include/freetype -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkfreetype/include/freetype/config -I/Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkfreetype/include/freetype/internal -I/Users/stubbler/Library/Developer/Xcode/DerivedData/SimpleCocoaVTK-gbtxjsaivazkvcfrgcddlupyumoy/Build/Intermediates/SimpleCocoaVTK.build/Debug/SimpleCocoaVTK.build/DerivedSources/i386 -I/Users/stubbler/Library/Developer/Xcode/DerivedData/SimpleCocoaVTK-gbtxjsaivazkvcfrgcddlupyumoy/Build/Intermediates/SimpleCocoaVTK.build/Debug/SimpleCocoaVTK.build/DerivedSources -F/Users/stubbler/Library/Developer/Xcode/DerivedData/SimpleCocoaVTK-gbtxjsaivazkvcfrgcddlupyumoy/Build/Products/Debug -MMD -MT dependencies -MF /Users/stubbler/Library/Developer/Xcode/DerivedData/SimpleCocoaVTK-gbtxjsaivazkvcfrgcddlupyumoy/Build/Intermediates/SimpleCocoaVTK.build/Debug/SimpleCocoaVTK.build/Objects-normal/i386/MyDocument.d --serialize-diagnostics /Users/stubbler/Library/Developer/Xcode/DerivedData/SimpleCocoaVTK-gbtxjsaivazkvcfrgcddlupyumoy/Build/Intermediates/SimpleCocoaVTK.build/Debug/SimpleCocoaVTK.build/Objects-normal/i386/MyDocument.dia -c /Users/stubbler/develop/Graphics/VTK/VTK-f52fb8d/MyDocument.mm -o /Users/stubbler/Library/Developer/Xcode/DerivedData/SimpleCocoaVTK-gbtxjsaivazkvcfrgcddlupyumoy/Build/Intermediates/SimpleCocoaVTK.build/Debug/SimpleCocoaVTK.build/Objects-normal/i386/MyDocument.o

In file included from /Users/stubbler/develop/Graphics/VTK/VTK-f52fb8d/MyDocument.mm:3:
In file included from /Users/stubbler/develop/Graphics/VTK/VTK-f52fb8d/BasicVTKView.h:5:
In file included from /Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkRenderer.h:32:
In file included from /Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkViewport.h:32:
In file included from /Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkObject.h:41:
In file included from /Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkObjectBase.h:43:
In file included from /Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkIndent.h:24:
In file included from /Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkSystemIncludes.h:40:
In file included from /Users/stubbler/develop/Graphics/VTK/VTKBuild/include/vtk-5.10/vtkIOStream.h:37:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/iomanip:44:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/istream:43:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/ios:44:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/char_traits.h:45:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:321:7: error: use of undeclared identifier 'ostreambuf_iterator'
                                  ostreambuf_iterator<_CharT> >::__type
                                  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:321:27: error: '_CharT' does not refer to a value
                                  ostreambuf_iterator<_CharT> >::__type
                                                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:319:21: note: declared here
  template<typename _CharT>
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:321:35: error: expected unqualified-id
                                  ostreambuf_iterator<_CharT> >::__type
                                                              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:326:9: error: use of undeclared identifier 'ostreambuf_iterator'
                                    ostreambuf_iterator<_CharT> >::__type
                                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:326:29: error: '_CharT' does not refer to a value
                                    ostreambuf_iterator<_CharT> >::__type
                                                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:324:21: note: declared here
  template<typename _CharT>
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:326:37: error: expected unqualified-id
                                    ostreambuf_iterator<_CharT> >::__type
                                                                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:331:5: error: variable '__copy_aux' declared as a template
    __copy_aux(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>,
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:331:16: error: use of undeclared identifier 'istreambuf_iterator'
    __copy_aux(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>,
               ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:331:36: error: '_CharT' does not refer to a value
    __copy_aux(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>,
                                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:329:21: note: declared here
  template<typename _CharT>
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:331:43: error: expected expression
    __copy_aux(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>,
                                          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:407:18: error: use of undeclared identifier 'ostreambuf_iterator'
                                    ostreambuf_iterator<_CharT> >::__type
                                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:407:38: error: '_CharT' does not refer to a value
                                    ostreambuf_iterator<_CharT> >::__type
                                                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:405:21: note: declared here
  template<typename _CharT>
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:407:46: error: expected unqualified-id
                                    ostreambuf_iterator<_CharT> >::__type
                                                                ^


********* End output ***********


I updated the header and library search paths in the Xcode project settings to point at the files in my vtk build folder, and I'm building against the 10.7 SDK, although I get the same errors with the 10.6 SDK. Maybe the problem lies in the xcode setup but I'm not sure where to look. Any ideas?

Thanks in advance

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120622/1f42a4bd/attachment.htm>


More information about the vtkusers mailing list