库未加载:../../Bin/Release/libXnVNite_1_4_0.dylib

发布于 2024-12-14 00:48:27 字数 1102 浏览 0 评论 0原文

当我用 openni 做一个项目时。当我制作 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.

我的 cmake 文件

 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)

会生成我的 makefile,然后我会制作它。

错误中提到的文件不在我的系统上(../../Bin/Release/libXnVNite_1_4_0.dylib)。虽然有一个 libXnVNite.dylib 文件,但 ../../Bin/Release/ 文件夹中不存在该文件。我在 osx 10.7 上工作,

知道如何解决这个问题吗?

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 ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

纵性 2024-12-21 00:48:27

为了解决这个问题,我将现有的 libXnVNite.dylib 重命名为 libXnVNite_1_4_0.dylib 并创建了一个相对于我的应用程序的文件夹 /bin/release 并将文件存放在其中。它有效,但我认为这远不是一个好的解决方案。

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.

天涯离梦残月幽梦 2024-12-21 00:48:27

更优雅的解决方案是在该相对文件夹中创建符号链接。
../../Bin/Release/libXnVNite_1_4_0.dylib -> /usr/lib/libXnVNite.dylib

等所有有问题的库。

这曾经对我有用,但现在它不再工作了......

一个更优雅的解决方案是使用 install_name_tool 将这些相对路径更改为真实路径。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文