How to build Qt from sources and get binaries like in maintenance tool



  • Hello,
    I want to build Qt from sources on linux unbuntu 16.04 and get binaries that behave same as the one's that come from maintenance tool(Qt 5.8 Desktop gcc 64-bit) and is located in home/user/Qt/5.8/gcc_64 . When I build binaries myself and set kit, compiler, debugger I get errors that It can't find files in system folders.
    If I understand correctly I should run cofigure with settings like these:
    -prefix <dir>
    -extprefix <dir>
    -hostprefix [dir]
    -external-hostbindir <path>
    -sysroot <dir>
    But I don't know which one to choose.


  • Moderators

    @Eligijus said in How to build Qt from sources and get binaries like in maintenance tool:

    -hostprefix [dir]
    -external-hostbindir <path>
    -sysroot <dir>

    You don't need these if you don't do cross-compilation



  • @jsulm Alright then what would be the difference between
    -prefix <dir>
    -extprefix <dir>
    and which one should I use?


  • Moderators

    @Eligijus call configure with -h parameter then you will see:
    "-prefix <dir> ...... The deployment directory, as seen on the target device.
    [/usr/local/Qt-$QT_VERSION, $PWD if -developer-build]
    -extprefix <dir> ... The installation directory, as seen on the host machine.
    [SYSROOT/PREFIX]"



  • Figured it out. Maybe someone will find what I did useful:

    1. Downloaded sources from Qt maintenance tool.
    2. Created directory i.e. /home/user/t_build .
    3. Ran configure script from downloaded sources folder (/home/user/Qt/5.8/Src) with prefix option where I want binaries installed /home/user/Qt/Src/configure -prefix /home/user/Qt/5.8/gcc_64. Running configure script from another folder is called shadow build and doesn't mix binaries with sources.
    4. Ran make in shadow build folder and then make install which installed binaries to /home/user/Qt/5.8/gcc_64 and I could compile project with my modifications to Qt code.

    But I still have no clue what -extprefix <dir> is used for.


Log in to reply
 

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