[vtkusers] problem compiling VTK 5.10.0 rc2 on a Mac

A A azata42 at gmail.com
Tue Apr 10 20:53:11 EDT 2012


My build configuration is just like yours but still fails. Not sure
yet why they differ. However, I was able to get to build by changing
lines 62-68 of the file Charts/vtkContextScenePrivate.h to read:

//#ifdef VTK_CONST_REVERSE_ITERATOR_COMPARISON
//  typedef std::vector<vtkAbstractContextItem*>::const_reverse_iterator
//    const_reverse_iterator;
//#else
  typedef std::vector<vtkAbstractContextItem*>::reverse_iterator
    const_reverse_iterator;
//#endif

which would be the same as undefining
VTK_CONST_REVERSE_ITERATOR_COMPARISON, since for some reason that
constant is being defined when it shouldn't.





On Tue, Apr 10, 2012 at 3:57 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> Follow-up: My build succeeded (with CMake set up as below).
> I should add: BUILD_SHARED_LIBS was ON.
>
>
> On Tue, Apr 10, 2012 at 11:20 AM, David Gobbi <david.gobbi at gmail.com> wrote:
>> I tested this a few weeks ago and it worked perfectly.  I started a
>> fresh build with 5.10rc2 just to be sure.
>>
>> CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
>> CMAKE_OSX_ARCHITECTURES:STRING=i386
>> CMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.5
>> CMAKE_OSX_SYSROOT:PATH=/Developer/SDKs/MacOSX10.5.sdk
>> CMAKE_USE_CARBON:BOOL=ON
>>
>> This is gcc 4.2.1, xcode 3.2.6.  It should also be possible to build
>> with gcc 4.0, though I haven't tried since VTK 5.8.
>>
>>  - David
>>
>> On Tue, Apr 10, 2012 at 10:46 AM, A A <azata42 at gmail.com> wrote:
>>> When I build VTK 5.10.0 rc2 on a mac running OS X 10.6 with the
>>> default options, it builds fine. But when I set the following:
>>>
>>> CMAKE_OSX_DEPLOYMENT_TARGET  = 10.5
>>> CMAKE_OSX_SYSROOT = /Developer/SDKs/MacOSX10.5.sdk
>>>
>>> the following compiler error occurs:
>>>
>>> [ 97%] Building CXX object
>>> Charts/CMakeFiles/vtkCharts.dir/vtkAbstractContextItem.cxx.o
>>> /Users/test/software/vtk/vtk-5.10.0-rc2/VTK5.10.0.RC2/Charts/vtkAbstractContextItem.cxx:
>>> In member function ‘virtual vtkAbstractContextItem*
>>> vtkAbstractContextItem::GetPickedItem(const vtkContextMouseEvent&)’:
>>> /Users/test/software/vtk/vtk-5.10.0-rc2/VTK5.10.0.RC2/Charts/vtkAbstractContextItem.cxx:166:
>>> error: no match for ‘operator!=’ in ‘it != std::vector<_Tp,
>>> _Alloc>::rend() [with _Tp = vtkAbstractContextItem*, _Alloc =
>>> std::allocator<vtkAbstractContextItem*>]()’
>>> /Users/test/software/vtk/vtk-5.10.0-rc2/VTK5.10.0.RC2/Common/vtkWeakPointerBase.h:97:
>>> note: candidates are: bool operator!=(const vtkWeakPointerBase&, const
>>> vtkWeakPointerBase&)
>>> /Users/test/software/vtk/vtk-5.10.0-rc2/VTK5.10.0.RC2/Common/vtkWeakPointerBase.h:97:
>>> note:                 bool operator!=(vtkObjectBase*, const
>>> vtkWeakPointerBase&)
>>> /Users/test/software/vtk/vtk-5.10.0-rc2/VTK5.10.0.RC2/Common/vtkWeakPointerBase.h:97:
>>> note:                 bool operator!=(const vtkWeakPointerBase&,
>>> vtkObjectBase*)
>>> make[2]: *** [Charts/CMakeFiles/vtkCharts.dir/vtkAbstractContextItem.cxx.o]
>>> Error 1
>>> make[1]: *** [Charts/CMakeFiles/vtkCharts.dir/all] Error 2
>>> make: *** [all] Error 2
>>>
>>> Is there a way to build the new version of vtk on macs running 10.6
>>> and still support 10.5?



More information about the vtkusers mailing list