I'm trying to build a qbs project using the leap motion library but on running the project am given the following error:
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
My qbs file:
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 is in that location.
Using Qt 5.6.0
New to using qbs so any help / pointers greatly appreciated.
This is not a qbs-specific issue, but rather requires understanding of how dynamic libraries are loaded on macOS. Please check the documentation on dyld and Run-Path Dependent Libraries .
That said, based on the install name of your dependent shared library libLeap.dylib, if you copy it to the same directory as your LeapTest application binary, it should be loaded successfully.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.