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

cmake build of a Qt project with static Qt linkage fails due to error in qtbase/cmake/FindWrapResolv.cmake

XMLWordPrintable

    • 759647636 (dev), 79d32d5b0 (6.7), 3d53016d1 (6.6)

      The file FindWrapResolv.cmake  (qtbase/cmake and lib/cmake/Qt6/ and copied to the installation directory) is used to test for the availability of the LIBRESOLV libraries.
      To probe the following code fragment is used:

      int main(int, char **argv) 
      {    
            res_state statep;    
            int n = res_nmkquery(statep, 0, argv[1], 0, 0, NULL, 0, NULL, NULL, 0);    
            n = res_nsend(statep, NULL, 0, NULL, 0);     
            n = dn_expand(NULL, NULL, NULL, NULL, 0);    
            return n; 
      }
      

      The culprit is the declaration: res_state statep;
      In the next line it is passed into req_nmkquery. The compiler complains (error) because statep is used without being initialised.
      Consequently, the test fails. The net effect is that the full QNetwork module is set to "not found".

      The remedy is simple: initialise with statep = nullptr;

      This solves the whole issue.

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

            manordheim Mårten Nordheim
            bwvb Bw vB
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes