Nominate our 2022 Qt Champions!

qmake, Mac OS X, dylib and bundles

  • I'm trying to pack the OpenCV's dylibs to my bundle. That's the snippet of my .pro file:

    LIBS += $$system(/usr/local/bin/pkg-config --libs opencv)
    RESFILES.files = /usr/local/lib/libopencv_calib3d.2.4.dylib /usr/local/lib/libopencv_contrib.2.4.dylib ... (too long list to put here)
    RESFILES.path = Contents/MacOS

    My app works well on my development machine, and it copies all the dylibs files to the path "Contents/MacOS". But when I try run it from my deploy machine it still try to run dylibs files from /usr/local/lib, which doesn't exists there. I've got:

    Dyld Error Message:
    Library not loaded: */libopencv_ocl.2.4.dylib
    Referenced from: /Users/USER/Downloads/
    Reason: image not found

    What am I forgetting?
    Thank you!

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Did you run macdeployqt on your bundle ?

Log in to reply