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: Problem with libltdl



On Dec 14, 2004, at 12:19 PM, Thomas DEGRIS wrote:

For a more general point of view, is MacOSX able to load multiple libraries defining the same symbol ? If yes, do you know projects (using libtools and automake) that use this method ?

...I'm having some problems with this, too: we use NSLinkModule() for our bundle loading...when you use NSLINKMODULE_OPTION_PRIVATE, multiple libraries defining the same (global) symbol can be loaded because each module has it's own "namespace"...unfortunately, this made it impossible (or rather, I haven't found a way yet) to call functions from other loaded modules...


...when you don't use the OPTION_PRIVATE, the app will crash when a module containing a duplicate symbol is loaded...this crash can be avoided by using another flag, NSLINKMODULE_OPTION_RETURN_ON_ERROR...but the module still doesn't load...

...if it helps, this is what I'm using now:

        ret = NSLinkModule( image, filename,
               NSLINKMODULE_OPTION_BINDNOW |
               NSLINKMODULE_OPTION_RETURN_ON_ERROR);

        if (ret == NULL) {
        	int err;
        	const char *fname, *errt;
        	NSLinkEditErrors c;
        	NSLinkEditError(&c, &err, &fname, &errt);
        	post("link error %d %s %s", err, fname, errt);
        	return 0;
        }

hth,
jamie

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/unix-porting/email@hidden

This email sent to email@hidden
References: 
 >Problem with libltdl (From: Thomas Degris <email@hidden>)
 >Re: Problem with libltdl (From: "Peter O'Gorman" <email@hidden>)
 >Re: Problem with libltdl (From: Thomas Degris <email@hidden>)
 >Re: Problem with libltdl (From: Thomas DEGRIS <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.