Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Deploying *.dylib. How?



  • Hello all!

    I am trying to add *.dylib to my project. Been following instruction on website. Library added automatically via Qt Creator but I still have this result:

    $ source /var/folders/zg/syfhtrq10f76f7f68th5l3540000gn/T/tmpZRMHrK
    dyld: Library not loaded: @rpath/libzip.5.dylib
      Referenced from: /Users/alexandr/Projects/study/qt/plainc_libzip/build-plainc_libzip-Desktop_Qt_5_12_1_clang_64bit-Debug/plainc_libzip
      Reason: image not found
    Press <RETURN> to close this window...
    

    My *.pro file looks like (most of content generated by QtCreator):

    TEMPLATE = app
    CONFIG += console
    CONFIG -= app_bundle
    CONFIG -= qt
    
    SOURCES += \
            main.c
    
    HEADERS += \
        zip.h \
        zip.h \
        config.h \
        zipconf.h
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/./release/ -lzip.5.0
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/./debug/ -lzip.5.0
    else:unix: LIBS += -L$$PWD/./ -lzip.5.0
    
    INCLUDEPATH += $$PWD/.
    DEPENDPATH += $$PWD/.
    
    LIBS += -L$$PWD/./ -llibzip.5.0.dylib
    
    #DISTFILES += \
    #    libzip.5.0.dylib \
    #libzip.5.dylib \
    #libzip.dylib
    

    Is there any valid reference or manual for adding *.dylib files?


  • Lifetime Qt Champion

    Hi,

    You need to add the DYLD_LIBRARY_PATH environment variable in the Run part of the project panel and point it to the folder where that library is located.


Log in to reply