[Ecls-list] load-foreign-library

Juan Jose Garcia-Ripoll jjgarcia at users.sourceforge.net
Tue Oct 24 13:55:39 UTC 2006


2006/10/24, Rick Taube <taube at uiuc.edu>:
> CM> (pm:portmidi)
> FIND-FOREIGN-SYMBOL: Could not load foreign symbol "_Pm_Initialize"
> from module :DEFAULT (Error: NIL)
> Broken at PORTMIDI:PORTMIDI.
> CM>>

I have found myself that when loading symbols with dlopen() the
initial underscore is prepended automatically by OS X. Could this be
the problem?

As an example, before moving to dlopen(), the entry point of a FASL
file was identified as _init_CODE. Now that we use dlopen(), even
though the program 'nm' still reports the symbol as _init_CODE, we
have to use dlsym("init_CODE"), without the leading underscore.

I think the rationale for the way dlysm() works is that _all_ symbols
from a C program have this underscore in front (at least in OS X).
Also it simplifies porting program from Linux/BSD where this initial
underscore is missing.

If you still have problems, I would ask you to send me a tarball with
the sources and a couple lines instructions so that I can debug it
myself.

> i just did another cvs update thinking that anonymous cvs might not
> have contained the fix but some ecl sources are in mid-stream i guess
> and wont build on osx:

Sorry, I normally do not check builds with threads because currently
the tests suite takes too much time. The error you find is related to
the trimming of ECL's headers. I have already added the corresponding
headers to ecl/internal.h (which is normally not loaded by embedding
programs) to compensate for the missing definitions. This has been
built and tested on a OS X G4 today (15:55)

Juanjo




More information about the ecl-devel mailing list