Problem loading a dylib file through LOAD-FOREIGN-FUNCTION
Robert P. Goldman
rpgoldman at sift.info
Mon Aug 26 00:54:37 UTC 2013
Luís Oliveira wrote:
> On Sun, Aug 25, 2013 at 3:34 PM, Robert P. Goldman <rpgoldman at sift.info> wrote:
>> $ file /usr/local/lib/libsmvgrammar.0.dylib
>> /usr/local/lib/libsmvgrammar.0.dylib: Mach-O universal binary with 1
>> architecture: [x86_64: Mach-O 64-bit x86_64 dSYM companion file]
>
> This description doesn't look right. The dylibs on my system look like this:
>
> $ file libtest.dylib
> libtest.dylib: Mach-O 64-bit dynamically linked shared library x86_64
>
> Perhaps the project you're compiling should be passing -dynamiclib to
> gcc but isn't?
>
Actually, I think what's wrong is that dlopen is goIng pear-shaped when it tries to load the dSYM companion file. This is a file that seems to be ancillary to libsmvgrammar.dylib, which IS a dynamically linked shared library:
$ file /usr/local/lib/libsmvgrammar.dylib
/usr/local/lib/libsmvgrammar.dylib: Mach-O universal binary with 1 architecture: [x86_64: Mach-O 64-bit x86_64 dynamically linked shared library]
$ file /usr/local/lib/libsmvgrammar.0.dylib
/usr/local/lib/libsmvgrammar.0.dylib: Mach-O universal binary with 1 architecture: [x86_64: Mach-O 64-bit x86_64 dSYM companion file]
The main library file I am trying to load somehow references libsmvgrammar.0.dylib, causing it to be loaded with dlopen and then I get the error. But I can't see why it would be trying to dlopen() what seems like a symbol table.
More information about the cffi-devel
mailing list