Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to package the dynamic library? After packaging with macdeployqt, it is found that the referenced library is not in it.

How to package the dynamic library? After packaging with macdeployqt, it is found that the referenced library is not in it.

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 236 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    senmx
    wrote on last edited by senmx
    #1

    How to package the dynamic library? After packaging with macdeployqt, it is found that the referenced library is not in it.

    macdeployqt x.app -qmldir=qml
    

    app.pro

    macx {
        LIBS += -L$$PWD/libs/macos/ -lcrypto -lssl -lmylib
        INCLUDEPATH += $$PWD/libs/macos/
    }
    

    When running:

    Application Specific Information:
    dyld: launch, loading dependent libraries
    
    Dyld Error Message:
      Library not loaded: mylib.dylib
      Referenced from: /Volumes/VOLUME/*/xx.app/Contents/MacOS/xx
      Reason: image not found
    
    S 1 Reply Last reply
    0
    • S senmx

      How to package the dynamic library? After packaging with macdeployqt, it is found that the referenced library is not in it.

      macdeployqt x.app -qmldir=qml
      

      app.pro

      macx {
          LIBS += -L$$PWD/libs/macos/ -lcrypto -lssl -lmylib
          INCLUDEPATH += $$PWD/libs/macos/
      }
      

      When running:

      Application Specific Information:
      dyld: launch, loading dependent libraries
      
      Dyld Error Message:
        Library not loaded: mylib.dylib
        Referenced from: /Volumes/VOLUME/*/xx.app/Contents/MacOS/xx
        Reason: image not found
      
      S Offline
      S Offline
      senmx
      wrote on last edited by
      #2

      @senmx install_name_tool -change "mylib.dylib" "@rpath/mylib/mylib.dylib" xx.app/Contents/MacOS/xx
      And copy mylib.dylib to xx.app/Contents/Frameworks/mylib/

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved