[vtkusers] [Snapshot-users] How to compile Qt-4.5.x for Mac OS X 10.5.5 to use 64-bits and Cocoa bindings

Michael Jackson mike.jackson at bluequartz.net
Fri Sep 26 16:26:08 EDT 2008


Use otool -L [path to the plugin] and look at the output. It will tell  
you exactly what all it is linking against.

Next, go in the vtkCarbonRenderWindow.h and at the very top put the  
following:

#error THIS IS A CARBON SOURCE CODE FILE. IT SHOULD NOT BE INCLUDED.

Compile. You _should_ get that error which means there are checks  
missing and the vtkCarbonRenderWindow code is being included in the  
compile, which should NOT be happening.

Mike

On Sep 26, 2008, at 4:12 PM, Elvis Dowson wrote:

> Hi,
>       A couple of things, the default *.xcodeproj that was created  
> didn't include the Cocoa.framework libraries. It still defaulted to  
> Carbon, despite my setting both Qt and vtk to use Cocoa bindings.
>
> Upon linking, I find that there are many un-resolved references to  
> vtkCarbon methods, which means that something is going wrong, and  
> the vtkCocoa methods are not being used.
>
> <pastedGraphic.png>
>
>
> I have attached the project files here.
>
> <QVTKCocoaTest.zip>
>
>
>
> Here is a copy of the QVTKWidget plugin that should go into the  
> Qt-4.5.x plugins/designer folder. I really am not sure if this  
> plugin is using Carbon or Cocoa. Is there a way to find out which  
> framework an application is using?
>
> <libQVTKWidgetPlugin.dylib>
>
>
>
> Best regards,
>
> Elvis
>
>
> On Sep 26, 2008, at 10:12 PM, Michael Jackson wrote:
>
>> I think what they are doing is FORCING a Cocoa build if one selects  
>> a 64 bit build of Qt. Just guessing but that does kinda make sense.  
>> You still could build Qt 4.5 with Carbon support for 32 Bit systems.
>>
>> You will probably have to follow the flow of the code to get a  
>> better feel for the context that that bit of code is executed in.
>>
>> Mike Jackson
>>
>> On Sep 26, 2008, at 1:39 PM, Elvis Dowson wrote:
>>
>>> Hi Trenton,
>>> 			In the file qglobal.h, I found a definition called  
>>> QT_MAC_USE_COCOA.
>>>
>>> Upon closer investigation, I find that it is only enable in  
>>> Qt-4.5.x if 64-bit support is turned on.
>>>
>>> #ifdef AUTODETECT_COCOA
>>> #  ifdef Q_OS_MAC64
>>> #    define QT_MAC_USE_COCOA 1
>>> #  endif
>>> #endif			
>>>
>>> So, this means that Cocoa support in Qt-4.5.x is only enabled if I  
>>> enable 64-bits.
>>>
>>> Could you please clarify if indeed, Qt-4.5.x will work for Cocoa  
>>> 32-bits?
>>>
>>> Best regards,
>>>
>>> Elvis Dowson
>>>
>>>
>>> On Sep 26, 2008, at 8:49 PM, Trenton Schulz wrote:
>>>
>>>>
>>>> On Sep 26, 2008, at 17:48 , Elvis Dowson wrote:
>>>>
>>>>> Hi,
>>>>>    I tried running
>>>>>
>>>>> make clean
>>>>> make distclean
>>>>> and re-running the configure command, but I got the same error  
>>>>> as before.
>>>>>
>>>>> What should I do? If Cocoa bindings work only for 64-bits,  
>>>>> shouldn't Qt-4.5.x automatically force and set it to 64-bits?
>>>>
>>>> No, Cocoa works for both 32-bit and 64-bit.
>>>>
>>>> What I suggested was to remove the entire qt-mac-... directory  
>>>> and untar it from scratch. Then you have a clean setup.
>>>>
>>>> -- Trenton
>>>>
>>>
>>> _______________________________________________
>>> This is the private VTK discussion list.
>>> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>




More information about the vtkusers mailing list