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. Build statically linked app for mac

Build statically linked app for mac

Scheduled Pinned Locked Moved Solved Installation and Deployment
4 Posts 2 Posters 586 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.
  • C Offline
    C Offline
    camccar
    wrote on last edited by
    #1

    I am trying to follow the instructions here to build a statically linked app to distribute to my team members who do not have QT installed. (We are a golang shop). However; it is not working for me.

    it says

    cd /path/to/Qt
    ./configure -static <other parameters>
    make sub-src
    

    I have QT installed in ~/Qt.

    And if I go there I find a configure file in ~/Qt/5.12.7/src.

    I can run ./configure -static.

    I can't run make sub-src, that doesn't work but I can run just make. It takes a few hours to finish.

    I then open my project in QT Creator and set the build to release, then run Qmake from qt creator.

    I find a directory called build-appname-release in the same folder as source code. I can then go in there run

    make clean
    make
    

    and I have an executable. When I run

    otool -L myapp.app/Contents/MacOs/myapp
    

    I see

    	@rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.12.0, current version 5.12.7)
    	@rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.12.0, current version 5.12.7)
    	@rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.12.0, current version 5.12.7)
    

    I assume this mean's it is not statically linked and if I give this to my teammates it will not work. What am I doing wrong

    TLDR: How can I produce a statically linked app from a simple QT project to distribute to my teammates who don't have QT installed. The current approach outlined in the docs don't seem to work.

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

      Hi and welcome to devnet,

      The most straightforward is to keep using your dynamic build of Qt and use macdeployqt to prepare your bundle for distribution.

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

      C 1 Reply Last reply
      2
      • SGaistS SGaist

        Hi and welcome to devnet,

        The most straightforward is to keep using your dynamic build of Qt and use macdeployqt to prepare your bundle for distribution.

        C Offline
        C Offline
        camccar
        wrote on last edited by
        #3

        @SGaist Hey thanks that seems to work. I'm not sure what the -qmldir thing is about but it seems to work with Qt moved to another folder

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

          The qmldir option is to point the tool to your qml sources, if you use any, so that the corresponding dependencies are also deployed.

          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
          1

          • Login

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