我正在使用Objective-C ++开发一个使用OpenCV和VTK动态库的应用程序,但是我在分发方面遇到了问题,如果我在不同的系统中启动我的应用程序,我遇到了这个问题:
Dyld错误消息:
Library not loaded: @executable_path/../Frameworks/libvtkCommon.5.6.1.dylib
Referenced from: /myApp.app/Contents/MacOS/myApp
Reason: no suitable image found. Did find:
/myApp.app/Contents/MacOS/../Frameworks/libvtkCommon.5.6.1.dylib: open() failed with errno=13
/myApp.app/Contents/MacOS/../Frameworks/libvtkCommon.5.6.1.dylib: open() failed with errno=13
我用install_name_tool重建我的dylib指向:@executable_path/../Frameworks
并且在myApp的目标的“构建阶段”我为我的dylib添加了目标“Frameworks”的“复制文件”阶段。问题出在哪儿?
检查应用程序包并确保复制到Frameworks中的文件是实际的dylib而不是符号链接文件。另外,你是否在dylib文件和可执行文件上运行install_name_tool?以共享库下的at this page为例。