Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / March 2004



Tip: Looking for answers? Try searching our database.

dynamically load a Mach-O library

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rolf Nilsson - 07 Mar 2004 11:22 GMT
Hi,

I want to dynamically load a library (in this case the Lame mp3 encoder)
which is located in
/usr/local/bin/
the name of the library is "lame"

what function calls should I use?

I've never did this under OS X but am used to the similar things with OS 9
and Windows

I've googled for it but really don't know what the appropriate words to use
are

Thanks for any help

Rolf
Ben EJ - 07 Mar 2004 22:26 GMT
I'm trying to do the same thing.  So far, I've found (just through
research, not actually trying to do it) that it is possible to use the
gcc dlopen, dlsym, dlclose functions by including dlfcn.h.  However,
Macintosh suggests that you use its newer functions from the Mach-O
SDK - NSLoadImageFileFromFile, NSLinkModule, etc. located in the
header <mach-o/dyld.h>.  I've found sample source that does this, so I
tried it myself. However, as I posted a few days ago, I am getting
"illegal bitfield" errors within the file loader.h, also included by
dyld.h.  Maybe there is a setting I'm supposed to look for, or some
#define I should declare.

Also, the documentation on these functions talks about only loading
filed linked with the -bundle option.  Does that mean I have to
compile my library as a bundle instead of a dynamic library?  Not sure
how to proceed.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.