Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Confusing "Library not loaded" error on macOS.

Confusing "Library not loaded" error on macOS.

Scheduled Pinned Locked Moved Unsolved Qt 6
4 Posts 2 Posters 627 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.
  • D Offline
    D Offline
    davidspry
    wrote on 20 May 2021, 06:24 last edited by davidspry
    #1

    Hello.

    I'm trying to build and run a Qt project on macOS.

    The project was originally written for Linux, and it works on Linux with Qt5.

    I've been able to get the project to build on macOS with Qt6, but when I try to run the executable I see a 'Library not loaded' error, which either says

    dyld: Library not loaded: @rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport
      Referenced from: /Users/davidspry/Documents/Qt/6.0.3/clang_64/lib/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets
      Reason: image not found
    

    or

    dyld: Library not loaded: @rpath/QtMultimediaWidgets.framework/Versions/5/QtMultimediaWidgets
      Referenced from: /Users/davidspry/Documents/Qt/6.0.3/clang_64/lib/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets
      Reason: image not found
    

    However, I don't believe that the project uses the 'Multimedia Widgets' module. Here is the .pro file:

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    QT += core gui
    QT += webkit
    QT += webkitwidgets
    QT += printsupport
    QT += network
    QT += gui
    
    TARGET = hiped
    CONFIG += console
    CONFIG -= app_bundle
    
    TEMPLATE = app
    
    SOURCES += main.cpp \
        keylist.cpp \
        connection.cpp \
        connectionmanager.cpp \
        container.cpp \
        containerframe.cpp \
        containertoplevel.cpp \
        hipe_instruction.c \
        common.c \
        sanitation.cpp \
        instructionhandler.cpp
    
    HEADERS += main.hpp \
        ExpArray.hh \
        keylist.h \
        common.h \
        connection.h \
        connectionmanager.h \
        container.h \
        containerframe.h \
        containertoplevel.h \
        hipe_instruction.h \
        sanitation.h \
        instructionhandler.h
    
    QMAKE_CXXFLAGS += -std=c++17 -O3 -pthread
    LIBS += -pthread
    

    Can anyone suggest a way for me to get this working?

    Thank you.

    J 1 Reply Last reply 20 May 2021, 06:41
    0
    • D davidspry
      20 May 2021, 06:24

      Hello.

      I'm trying to build and run a Qt project on macOS.

      The project was originally written for Linux, and it works on Linux with Qt5.

      I've been able to get the project to build on macOS with Qt6, but when I try to run the executable I see a 'Library not loaded' error, which either says

      dyld: Library not loaded: @rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport
        Referenced from: /Users/davidspry/Documents/Qt/6.0.3/clang_64/lib/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets
        Reason: image not found
      

      or

      dyld: Library not loaded: @rpath/QtMultimediaWidgets.framework/Versions/5/QtMultimediaWidgets
        Referenced from: /Users/davidspry/Documents/Qt/6.0.3/clang_64/lib/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets
        Reason: image not found
      

      However, I don't believe that the project uses the 'Multimedia Widgets' module. Here is the .pro file:

      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
      
      QT += core gui
      QT += webkit
      QT += webkitwidgets
      QT += printsupport
      QT += network
      QT += gui
      
      TARGET = hiped
      CONFIG += console
      CONFIG -= app_bundle
      
      TEMPLATE = app
      
      SOURCES += main.cpp \
          keylist.cpp \
          connection.cpp \
          connectionmanager.cpp \
          container.cpp \
          containerframe.cpp \
          containertoplevel.cpp \
          hipe_instruction.c \
          common.c \
          sanitation.cpp \
          instructionhandler.cpp
      
      HEADERS += main.hpp \
          ExpArray.hh \
          keylist.h \
          common.h \
          connection.h \
          connectionmanager.h \
          container.h \
          containerframe.h \
          containertoplevel.h \
          hipe_instruction.h \
          sanitation.h \
          instructionhandler.h
      
      QMAKE_CXXFLAGS += -std=c++17 -O3 -pthread
      LIBS += -pthread
      

      Can anyone suggest a way for me to get this working?

      Thank you.

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 20 May 2021, 06:41 last edited by
      #2

      @davidspry said in Confusing "Library not loaded" error on macOS.:

      I don't believe that the project uses the 'Multimedia Widgets' module

      From the error message you can see that QtWebKitWidgets needs it.

      Do you start your project from QtCreator or manually from Finder/terminal?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Offline
        D Offline
        davidspry
        wrote on 20 May 2021, 11:54 last edited by
        #3

        Ok, I see. If QtWebKitWidgets depends on QtMultimediaWidgets, then my version of Qt (6.0.3) may be the issue. As I understand it, Qt 6.0 doesn't include QtMultimedia. I'll install Qt5 and see how that goes.

        As for starting the project, I've tried building from Terminal and from QtCreator. In both cases the project builds successfully but crashes when it's run.

        J 1 Reply Last reply 20 May 2021, 12:03
        0
        • D davidspry
          20 May 2021, 11:54

          Ok, I see. If QtWebKitWidgets depends on QtMultimediaWidgets, then my version of Qt (6.0.3) may be the issue. As I understand it, Qt 6.0 doesn't include QtMultimedia. I'll install Qt5 and see how that goes.

          As for starting the project, I've tried building from Terminal and from QtCreator. In both cases the project builds successfully but crashes when it's run.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 20 May 2021, 12:03 last edited by
          #4

          @davidspry said in Confusing "Library not loaded" error on macOS.:

          Qt 6.0 doesn't include QtMultimedia

          This is correct

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          1/4

          20 May 2021, 06:24

          • Login

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