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

Incorrect lib lookup

    XMLWordPrintable

Details

    • 925fd32a2d8fc6563ab5318344a223bbe6d686d9

    Description

      From: http://stackoverflow.com/questions/2417694/qt-pros-transformed-into-nmake-makefiles-cant-handle-staticlibs-same-thing-in

      When parsing the LIBS variable, for each entry -l qmake goes looking whether or not the file exists in the libpath. If it can find it, it adds an absolute link to the Makefile, if not it just adds the filename and lets nmake look for it itself.

      I had 2 entries: -lmystatic and -lmystatic2. The first time I generate my Makefile's, it writes:

      LIBS = ... mystatic.lib mystatic2.lib ...

      If I regenerate my Makefile's, it should write:

      LIBS = c:\sandbox\bin\mystatic.lib c:\sandbox\bin\mystatic2.lib

      instead, it writes:

      LIBS = c:\sandbox\bin\mystatic2.lib c:\sandbox\bin\mystatic2.lib

      What I think happened is that qmake takes the list of all files that match "mystatic", and takes the first one. Unfortunately "mystatic2.lib" also matches this AND "mystatic2.lib" ends up lexically BEFORE "mystatic.lib".

      The Qt Visual Studio integration does the exact same thing. VS filters out the duplicate but a .lib entry is missing along the includes. I haven't been able to find out why VS is able to link like this.

      Attachments

        Issue Links

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

          Activity

            People

              jbornema Joerg Bornemann
              pieter.verberck Pieter Verberck
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes