Howto build QT5.10.0 static on MAC



  • is there a step-by-step guide on how to build QT5.x static anywhere?

    Im trying to deploy an Application on OSX and want everything build into a single executable
    I am using external Libraries which are already build statically and work fine.

    i have a commercial license as well

    my QT folder ist ~/QT
    inside i found a 5.1.0/Src Tree within i can run the configure script. But exactly here i would need some help on how to set the right options. I want everything available to be build (just to make sure nothing is missing)

    any help?



  • ./configure --recheck-all --prefix=~/QT-static -static -nomake tools -static -release

    with this configure script make fails after a while with

    Undefined symbols for architecture x86_64:
    "_inflateValidate", referenced from:
    _png_inflate_claim in libqtlibpng.a(pngrutil.o)
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[4]: *** [books.app/Contents/MacOS/books] Error 1
    make[3]: *** [sub-books-make_first] Error 2
    make[2]: *** [sub-sql-make_first] Error 2
    make[1]: *** [sub-examples-make_first] Error 2
    make: *** [module-qtbase-make_first] Error 2


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Can you show the complete configure line ? By the way, you should add --nomake tests --nomake examples. You don't want any of them built.



  • thank you :-)

    ./configure --recheck-all --prefix=~/QT-static -static -release -nomake examples -nomake tests

    im trying this at the moment.. it is compiling.. no idea if this will work this time using -j 1 - takes ages



  • and finally failed again.. hmmm.. any ideas ?

    Undefined symbols for architecture x86_64:
    "_inflateValidate", referenced from:
    _png_inflate_claim in libqtlibpng.a(pngrutil.o)
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[4]: *** [../../../bin/Assistant.app/Contents/MacOS/Assistant] Error 1
    make[3]: *** [sub-assistant-make_first] Error 2
    make[2]: *** [sub-assistant-make_first] Error 2
    make[1]: *** [sub-src-make_first] Error 2
    make: *** [module-qttools-make_first] Error 2



  • @Tommy-Tom said in Howto build QT5.10.0 static on MAC:

    ./configure --recheck-all --prefix=~/QT-static -static -release -nomake examples -nomake tests

    after adding -nomake tools compiling works.
    after make install and moving it to the right position it still cannot activate this kit somehow...
    once i start the creator the following appears

    Performing API discovery ...
    C and C++ compiler paths differ. C compiler may not work.
    C and C++ compiler paths differ. C compiler may not work.
    Checking for license updates ...
    Checking for updated license succeeded (2 licenses fetched)
    Failed to set up kit for Qbs: Could not determine whether Qt is a static build.


  • Lifetime Qt Champion

    Did you do that from a clean source tree ? By the way, why --nomake tools ?

    As I already wrote many times: use out of source builds so you can nuke it if something fails and start over quickly.



  • @SGaist

    Tom:qt-build$ ~/Qt/5.10.0/Src/configure --prefix=/Users/Tom/Qt/5.10.0/clang_64-static -static -debug-and-release -nomake examples -nomake tests -commercial

    this is my configuration string. i am outside the Source tree (shadow build) and still, even with make -j 1 which takes almost 3 hours to compile (instead of 45mins -j 8) i still get the same error. i can only complete compile the KIT with --nomake tools but then i run into other problems with QTCreator because of that. The KIT is not recognized completely without tweaking. I really could need some help.

    Undefined symbols for architecture x86_64:
    "_inflateValidate", referenced from:
    _png_inflate_claim in libqtlibpng.a(pngrutil.o)
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[4]: *** [../../../bin/Assistant.app/Contents/MacOS/Assistant] Error 1
    make[3]: *** [sub-assistant-make_first] Error 2
    make[2]: *** [sub-assistant-make_first] Error 2
    make[1]: *** [sub-src-make_first] Error 2
    make: *** [module-qttools-make_first] Error 2



  • im going to try this configure string actually....

    ~/Qt/5.10.0/Src/configure --prefix=/Users/tom/Qt/5.10.0/clang_64-static -static -debug-and-release -nomake examples -nomake tests -commercial -qt-libpng -qt-zlib -qt-libjpeg -qt-xcb -qt-xkbcommon -qt-freetype -qt-pcre -qt-harfbuzz -platform macx-clang



  • after removing all packages (brew) with only wget left and the mentioned configure string it compiled...

    somehow the kit does not get detected automatically. is this normal ?


  • Lifetime Qt Champion

    Yes, you have to add it manually.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.