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: NSLinkModule in place of dlopen for frameworks



Parav Pandit wrote:

Hi,

I am porting one Linux library.
This library loads other shared libraries(.so) using dlopen() , dlclose(),
dlsym().
So I have
1. loader-Lib.so
2. tobe-loaded-lib.so
written in C.

I am referring to tech note:
http://developer.apple.com/technotes/tn2002/tn2071.html

Please ignore this tech note on this issue. The use of dlopen() is perfectly fine.



I want to convert both 1. loader-Lib.so 2. tobe-loaded-lib.so to cocoa frameworks.

I look in the <mach-o/dyld.h> for function
NSCreateObjectFileImageFromFile().
there is says this function is supported for only MH_BUNDLE type of Mach-o
files.


Yes, you can use NSAddImage or NSAddLibrary to add a framework or dylib.

Limitation to me is I don't know how may frameworks are there to be loaded
at compile time.
I have to take path of frameworks from list.conf file.
How can I load the framework's shared library at runtime using C program and
execute its code?
Do I have to use some other APIs?

Here is the code i tried.

I urge you to revert to dlopen().


Am I posting this message to correct mailing list? If not please direct me to correct mailing list.


Yes, this is the correct list.

Peter
--
Peter O'Gorman - http://www.pogma.com
_______________________________________________
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: 
 >NSLinkModule in place of dlopen for frameworks (From: "Parav Pandit" <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.