OS X runtime installing the wrong version of lib

I have a C ++ shared library from my Python program. C ++ lib compiled with HDF5, which I installed using homebrew on OS X, so it is located in /usr/local/lib. Now the problem is that I also installed PyTables, which includes an older version of libhdf5 installed somewhere in/Library/Frameworks/EPD64.framework/Versions/Current/...

I can compile and link my library just fine, but otool -Lreally points to /usr/local/lib/libhdf5.dylib. However, when I try to run it with Python, there is a version mismatch error. Somehow, the run-time linker loads the older hdf5 library.

One way to solve the problem is to create hdf5 as a static library, but I would like to find a more accurate solution - how can I convince the runtime linker to use the new library? I already tried setting DYLD_LIBRARY_PATH, but it just broke everything else (Python and MacVim did not start).

+3
source share
1 answer

Can you provide more information? I have several alternatives (and questions).

If I understood correctly, you have a library that uses lib_ver_a.dyld and pyTables that uses lib_ver_b.dyld. That is, the same library, but a different version.

You can:

  • , pyTables (DYLD_LIB... ), pyTables: DYLD_LIBRARY_PATH =/correct/path/lib python myprog.py

    /li >
  • xcode ( osx?). pyTables ( , )

, ( ).

dyld ( gcc ld ? , ):

gcc/path/lib1.dyld myLib.c -o myLib.o

, (! , ).

, .

,

0

Source: https://habr.com/ru/post/1794896/


All Articles