[vtkusers] OSX 10.6 TCL issue "libvtkRendering.5.4.dylib: GC capability mismatch" ( solution too )

Sean McBride sean at rogue-research.com
Fri Mar 5 12:05:37 EST 2010


On 3/5/10 7:39 AM, David Gobbi said:

>>> In fact, it might be wise for vtk to configure itself with -fobjc-gc by
>>> default.  One problem is that this flag is supported only as of 10.5.
>>> But perhaps some CMake wizardry could be done to check the deployment
>>> target and use -fobjc-gc only if it's >= 10.5.
>>
>> The check is easy to do, the CMakeLists.txt already has SDK version
>> checks.  So if the SDK is >= 10.5, VTK_REQUIRED_OBJCXX_FLAGS should
>> appear as an advanced option with a default setting of "-fobjc-gc".  I
>> can put this in sometime over the next few days.
>
>Just replying to myself: The -fobjc-gc flag setting is now in VTK cvs.

Thanks for doing this David!  But there is a problem.  You have tested
against the SDK version, but you should be testing against the
deployment target.  The difference is somewhat subtle.  Here's a
description (from some old list post) I kept in my notes:

"The SDK you choose specifies the *maximum* version of the OS that you
want to *use features from*.  There is another build setting, the
deployment target that specifies the *minimum* version of the OS that
you want to *run on*.

Any function that is supported on your Deployment target or earlier are
hard linked (and your software won't load on earlier versions of the
OS). Any functions that were introduced after your deployment target are
weak linked. Any functions introduced after your SDK version are unavailable.

Then any APIs that you use that were defined after your deployment
target, but before your SDK version must be tested for availability
before you call them, which is typically done by checking against NULL.
If they are not available, you can't call them."

So one could build VTK with the 10.6 SDK and a 10.4 deployment target. 
With your change, -fobjc-gc would be used and the resulting binary would
not run on 10.4.

To complicate matters, CMake's deployment target support is new... what
is the minimum CMake version that VTK must support?

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtkusers mailing list