Important: Please read the Qt Code of Conduct -

Error while building Qt from source

  • I am getting these errors while make command is executed. I am building from source by following the website instructions.

    from ../../corelib/global/qglobal.cpp:48:
    ../../../include/QtCore/../../src/corelib/kernel/qvariant.h: In constructor ‘QVariant::QVariant(QVariant&&)’:
    ../../../include/QtCore/../../src/corelib/kernel/qvariant.h:265:25: error: implicitly-declared ‘constexpr QVariant::Private& QVariant::Private::operator=(const QVariant::Private&)’ is deprecated [-Werror=deprecated-copy]
    265 | { other.d = Private(); }
    | ^
    ../../../include/QtCore/../../src/corelib/kernel/qvariant.h:380:16: note: because ‘QVariant::Private’ has user-provided ‘QVariant::Private::Private(const QVariant::Private&)’
    380 | inline Private(const Private &other) Q_DECL_NOTHROW
    | ^~~~~~~
    cc1plus: all warnings being treated as errors
    Makefile:1029: recipe for target '.obj/qglobal.o' failed
    make[3]: *** [.obj/qglobal.o] Error 1
    make[3]: Leaving directory '/home/mukul/qt5/qtbase/src/tools/bootstrap'
    Makefile:64: recipe for target 'sub-bootstrap-make_first' failed
    make[2]: *** [sub-bootstrap-make_first] Error 2
    make[2]: Leaving directory '/home/mukul/qt5/qtbase/src'
    Makefile:46: recipe for target 'sub-src-make_first' failed
    make[1]: *** [sub-src-make_first] Error 2
    make[1]: Leaving directory '/home/mukul/qt5/qtbase'
    Makefile:88: recipe for target 'module-qtbase-make_first' failed
    make: *** [module-qtbase-make_first] Error 2

    Please help !!

  • Moderators

    • which Qt version?
    • which operating system?
    • please specify your configure line

    all warnings being treated as errors

    This can be turned off, for example by not making a developer-build.

  • I am building version 5.13 for kde neon. I am building open source version from git.

  • Lifetime Qt Champion


    From git or from the source tar archive ?

  • @SGaist from git following website instructions.

  • Lifetime Qt Champion

    Which instructions ?

  • Moderators


    As said, do not use -developer-build flag unless you have to. If you are building Qt for own use, it's easier to use tarballs.

  • @sierdzio I haven't used this flag.

  • I got the errors after removing the flag too. I am a bit new to this, Can u please tell me how to build from tarballs?

  • Lifetime Qt Champion

    Similar procedure:

    • Download tarball
    • Uncompress
    • Create a build folder outside sources
    • Go inside build folder
    • Call configure with full path
    • Build
    • Install
    • Hack

Log in to reply