Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking glib-based library from Cocoa app



On Nov 4, 2003, at 12:27 PM, Scott Lamb wrote:
3) dynamically loading libraries. libgaim builds its prpls (protocol plugins) to load dynamically via gmodule (which does a dlopen() and similar, I assume). I can't get them to load; it always says it can't find the protocol plugin.

Currently it's building them as libBLAH.so. I'm not quite sure what that is. I know that under Linux, .so = shared object; I'd use it where I'd use a .dylib under OS X. So I suspect that these should actually be named .dylib. But file tells me they are different than dylibs somehow:

$ file liboscar.so
liboscar.so: Mach-O bundle ppc
$ file libgaim.0.0.0.dylib
libgaim.0.0.0.dylib: Mach-O dynamically linked shared library ppc
$ file librsync.a
librsync.a: current ar archive

And Under Linux, a .so is
$ file libc-2.3.2.so
libc-2.3.2.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped


I'm also going to ask about this on the gaim list (since there seem to be a lot of project-specific configure options about this) but the .so/.dylib question is likely to come up, and I don't think there are any OS X people on that list.

With some more searching, I think I've got the answer. libXXX.so is for dynamic loading. libXXX.dylib is for dynamic linking. libXXX.a is for static linking. You can toggle between generating .sos and .dylibs by adding or not adding the -module line to GNU libtool. So libgaim is actually doing the right thing here. And I saw that gmodule has had OS X support specifically added, so it should be able to load them. It's still not working, but I think I'm in good shape for getting it figured out on my own or with the gaim people.


I'd still appreciate help with #1 and #2...I'm completely stumped there.

Thanks,
Scott Lamb
_______________________________________________
unix-porting mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/unix-porting
Do not post admin requests to the list. They will be ignored.



References: 
 >Linking glib-based library from Cocoa app (From: Scott Lamb <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.