Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-71420

Linker errors building Qt from source on Linux

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P1: Critical
    • None
    • 5.9.6, 5.11.2
    • Build System
    • None
    • Ubuntu 16.04
    • Linux/X11

    Description

      I am trying to build Qt from source on Linux.
      System is Ubuntu 16.04 with GCC 5.4.

      I have experienced the same issue with 5.9.6 and 5.11.2.

      I am configuring it this way:

      ./configure -c++std c++14 -qt-pcre -qt-zlib -qt-libjpeg -qt-libpng -qt-harfbuzz -qt-freetype -skip qtwebengine -no-avx512
      

      And then just simply

      make -j8 install
      

      Early in the build, I get the following failure:

      /usr/bin/ld.gold: error: cannot find -lqtpcre2
      .obj/qregularexpression.o:qregularexpression.cpp:function safe_pcre2_match_16(pcre2_real_code_16 const*, unsigned short const*, int, int, int, pcre2_real_match_data_16*, pcre2_real_match_context_16*): error: undefined reference to 'pcre2_match_16'
      .obj/qregularexpression.o:qregularexpression.cpp:function safe_pcre2_match_16(pcre2_real_code_16 const*, unsigned short const*, int, int, int, pcre2_real_match_data_16*, pcre2_real_match_context_16*): error: undefined reference to 'pcre2_jit_stack_create_16'
      

      (Followed by a lot more missing symbols from pcre2).

      If I invoke make again, the build proceeds fine. 

      It also works fine if after the error I go to the following directory:

      ./qt-everywhere-src-5.11.2/qtbase/src/3rdparty/pcre2
      

      And invoke make there, and then invoke make from the top level directory. At that point, it failed again due to a similar issue with harfbuzz, for which I followed the same workaround.

      So, libpcre2.a is compiling just fine, but for some reason during the main build it is required before it was built.

      There have been times where I have got it to build without any errors, under the same conditions, so it doesn't appear to be 100% reproducible. However, most times I've tried, my build fails.

      Is it possible that the compile time dependencies are not being built in the right order? 

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              buddenha Oswald Buddenhagen
              jcar87 Luis Caro
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes