On Tue, May 4, 2010 at 4:46 PM, David Wilson <[hidden email]> wrote: Hi Hi and welcome! apiKLGetKeyboardLayoutCount Exactly. That's the problem. I can't figure out what the address should be. But you see the library in your computer, isn't it ? I mean, it is there, but FFI doesn't find it ? I'm not sure if I'm using FFI correctly, do I have to somehow include the external library in the Pharo VM? No, you shouldn't need to do that. However, you can try to put them there just to see if that's the problem. I think that at some point (depends on an order) the library is searched in the same place where you are calling from. So, yes, do a test, but just a test. It should work without doing that. How did you install FFI ? Which Pharo VM and image versions are you using ? Can anyone help? I would like too, but I don't have such library. I developed a wrapper for a Clibrary called OpenDBX using FFI. In our website, some people experimented similar problems. Please take a look to the title "Problems with Mac OS:" of the following link: http://www.squeakdbx.org/Compiling%20and%20installing%20OpenDBX I also cc'ed people that can help you. Cheers Mariano I'm looked for FFI examples, but don't find anything helpful. _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Well
/* * KLGetKeyboardLayoutCount() *** DEPRECATED *** * * Deprecated: * Use TISCreateInputSourceList API to create a list of input * sources that match specified properties. * * Summary: * Returns the number of keyboard layouts. * * Mac OS X threading: * Not thread safe * * Parameters: * * oCount: * On exit, the number of keyboard layouts * * Availability: * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.5 * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later * Non-Carbon CFM: not available */ That would imply you need to say module: 'Carbon.framework' If you look at the usage of FFI in Sophie, you'll find *lots* of examples just download the app run and tap "cmd-'.'" to get a debugger up. But I think there was an example in the FFI stuff once. Say: apicall: void 'GetMouse' (MacPoint) module:'Carbon.framework'> You can also set SqueakDebug to 1 in the Squeak VM's info.plist setting to get the VM to print lots more diagnostics info to the Console when it attempts to run for the entry point name . On 2010-05-05, at 2:10 PM, Mariano Martinez Peck wrote:
-- =========================================================================== John M. McIntosh <[hidden email]> Twitter: squeaker68882 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com =========================================================================== _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project smime.p7s (3K) Download Attachment |
Hi John
It works as you describe, thanks. Sorry only to reply now, your post didn't come to me via email (don't know why!) I only saw it today. David |
Free forum by Nabble | Edit this page |