3

我正在尝试使用跳跃运动库构建一个 qbs 项目,但在运行该项目时出现以下错误:

dyld: Library not loaded: @loader_path/libLeap.dylib
Referenced from: /Users/pball/Work/Code/Qt/build-LeapTest-Desktop-Debug/qtc_Desktop_95cbad6a-debug/install-root/LeapTest
Reason: image not found

我的 qbs 文件:

import qbs
CppApplication {
consoleApplication: true
files: "main.cpp"

Group {     // Properties for the produced executable
    fileTagsFilter: product.type
    qbs.install: true
}

cpp.includePaths: [".","/Users/pball/LeapSDK/include"]
cpp.libraryPaths: ["/Users/pball/LeapSDK/lib"]

cpp.dynamicLibraries: "Leap"
}

libLeap.dylib 在那个位置。

使用 Qt 5.6.0

使用 qbs 的新手,非常感谢任何帮助/指针。

4

1 回答 1

1

这不是特定于 qbs 的问题,而是需要了解如何在 macOS 上加载动态库。请查看有关dyldRun-Path Dependent Libraries的文档。

也就是说,根据依赖共享库 libLeap.dylib 的安装名称,如果将其复制到与 LeapTest 应用程序二进制文件相同的目录,它应该会成功加载。

于 2016-08-05T19:23:35.537 回答