Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [Solved] Qt5 and Mac libqcocoa
Forum Updated to NodeBB v4.3 + New Features

[Solved] Qt5 and Mac libqcocoa

Scheduled Pinned Locked Moved Installation and Deployment
6 Posts 2 Posters 4.8k Views 1 Watching
  • 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.
  • I Offline
    I Offline
    igormarkoff
    wrote on last edited by
    #1

    Hi,

    I built Qt (5.2.0) as described http://qt-project.org/wiki/Building_Qt_5_from_Git
    The only difference is that I built Qt with my namespace name:
    ./configure -developer-build -debug-and-release -qtnamespace MyNamespace -opensource -nomake examples -nomake tests
    since the application I try to run uses it working with Qt

    After that I could compile and run the application under Windows 7 and Mac OS X 10.7.5.

    The problems began when I try to run the application on other mac. I get next error all the time:

    This application failed to start because it could not find or load the Qt platform plugin "cocoa".

    Available platform plugins are: cocoa.

    I ran without sandboxing and tried both with and without patching Qt libraries and the application. For simplicity I even just copied Qt in the same folder on other mac machine so non patched application will refer to existing library files. No luck.
    Then I found that I need to modify library paths via QCoreApplication::setLibraryPaths and/or QApplication.addLibraryPath on application launch. Did it setting proper paths. Still no luck (always the same error).

    Does anybody experience the same problems trying to run a Qt5 application on other Mac machine?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Did you follow the "Mac deployment guide":http://qt-project.org/doc/qt-5.0/qtdoc/deployment-mac.html ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • I Offline
        I Offline
        igormarkoff
        wrote on last edited by
        #3

        Hello,
        Thank you for the response.

        Yes, I patched the bundle files, and saw that the application can find libqcocoa (I typed a command export DYLD_PRINT_LIBRARIES=1 before the application running so it prints all the libraries it works with) but after loading libqcocoa it says that it can not load or find it.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Can you run otool -L on libqcocoa to check the paths in it ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • I Offline
            I Offline
            igormarkoff
            wrote on last edited by
            #5

            Investigation with otool -L shows that libqcocoa depends on QtPrintSupport although the application doesn't use printing at all. Adding QtPrintSupport framework to the bundle and patching it as well solves the problem. Thank you very much for your help!!

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              You're welcome !

              Since you found out, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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