V4RB, what people think about switch to Macho ?

Justin Drury justin at crunch-recording.com
Tue Aug 9 16:50:01 CDT 2005


> Just for the heck of it I compiled my RB app as MACHO. It quits
> immediately on launch (on bounce or so) with no crash log. What else
> do I need to do to get it to launch? I thought PEF shared libraries
> work with MACHO. Must they be in the same bundle (i.e. not in
> CFMSupport)?
>
> Jon

Hey Jon, if you can compile it as a CFM plugin(although at that point  
you may as well compile mach-o), you'll be all set, Realbasic handles  
the internal glue code for Macho to call CFM/PEF function pointers.   
There's the often quoted...

http://developer.apple.com/samplecode/CFM_MachO_CFM/ 
CFM_MachO_CFM.html  that deals with all that stuff.  Its more  
complicated than it looks, in reality its about 10 lines of code  
which Apple provides...

However if you don't have the source code things are a little  
different.  You can put a PEF lib into a bundle structure, its pretty  
easy, I've done it myself, you just need to set some info.plist  
attributes.  Then if your c skills are up to chop you could write a  
plugin(CFM/MachO) that does the proper CFBundleLoadExecutable and  
CFBundleGetFunctionPointerForName calls and exposes them to  
REALBasic...I had to do this recently myself(Although I called in  
from cocoa using NSBundle).

Or as Charles suggested use RB2005(I wasn't aware they had added  
this, I imagine its doing the same things behind the scenes...)

Hope that helps

Justin


More information about the Valentina mailing list