qbs: dylib - library not loaded, image not found

  • 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 and I am able to work with the library when linking with qmake.

    Using Qt 5.6.0

    New to using qbs so any help / pointers greatly appreciated.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You likely have to add /Users/pball/LeapSDK/include to QMAKE_RPATHDIR.however I don't know how to do it with QBS, I haven't used it yet.

  • Just as a follow up, sorted this by copying libLeap.dylib into the same directory as the application binary.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.