Library not loaded: ../../Bin/Release/libXnVNite_1_4_0.dylib
-
20-02-2021 - |
Pergunta
When i'm making a project with openni. And have a problem when i make my makefile.
Starting /Users/olivierjanssens/Documents/ICT/Master/Thesis/Code/mysuperdemo/qtcreator- build/mysuperdemo...
dyld: Library not loaded: ../../Bin/Release/libXnVNite_1_4_0.dylib
Referenced from: /Users/olivierjanssens/Documents/ICT/Master/Thesis/Code/mysuperdemo/qtcreator-build/mysuperdemo
Reason: image not found
The program has unexpectedly finished.
My cmake file
cmake_minimum_required(VERSION 2.6)
PROJECT(mysuperdemo)
SET(NESTK_USE_OPENNI 1)
ADD_SUBDIRECTORY(nestk)
## nestk/UseNestk.cmake.in defines variable to use nestk.
## It itself includes nestk/deps/cmake/UseEmbeddedNestkDeps.cmake that
## contains most of the cmake find packages commands.
INCLUDE("${nestk_BINARY_DIR}/UseEmbeddedNestk.cmake")
ADD_EXECUTABLE(mysuperdemo mysuperdemo.cpp)
TARGET_LINK_LIBRARIES(mysuperdemo nestk)
this generates my makefile which i then make.
The file mentioned in the error is not on my system ( ../../Bin/Release/libXnVNite_1_4_0.dylib). Though there is a libXnVNite.dylib file but not in the ../../Bin/Release/ folder that which does not exist. I work on osx 10.7
any idea how i can fix this ?
Solução
To solve this i renamed the existing libXnVNite.dylib to libXnVNite_1_4_0.dylib and created a folder /bin/release relative to my application and deposited the file in it. It works but i think it is far from a good solution.
Outras dicas
A more elegant solution would be to create symlinks in that relative folder. ../../Bin/Release/libXnVNite_1_4_0.dylib -> /usr/lib/libXnVNite.dylib
and so on for all the problematic libraries.
That worked once for me, but now it's just working anymore...
An even more elegant solution would be to use install_name_tool to change those relative paths to the real ones.