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

Adding or removing source files breaks the build

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.2, 5.14.0 Alpha
    • 5.0.0
    • Build tools: qmake
    • None
    • Windows 7
    • 29d5a287abc3d3c9b75619db18042dea66236cb3 (qt/qtbase/5.12)

    Description

      Assume you have a project that was successfully built. Now you add a new source file introducing new symbols and you use them in your existing code. Even after doing qmake -r, the build will fail with a linker error complaining about unresolved symbols (see first attachment).
      Similarly, if you do the reverse, the build will fail on the "make" level, complaining about missing file dependencies (see second attachment).
      In both cases, removing the build directory first fixes the problem (but is obviously not a practical solution).

      Note that the problem seems only to occur on Windows.

      How to reproduce:
      1) Check out qbs: git clone ssh://<gerrit user>@codereview.qt-project.org:29418/qt-labs/qbs
      2) Point your checkout at commit b028f2d47cf228e051958c5c29d90c7b8bd38fba
      3) Build the project (I use a shadow build).
      4) Apply https://codereview.qt-project.org/#change,44866 (I used patch set 12) and build to see the first problem.
      5) Do a clean build, reset the git head and build again to see the second problem.

      Attachments

        1. link_error.txt
          5 kB
        2. make_error.txt
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jbornema Joerg Bornemann
            kandeler Christian Kandeler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes