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

Fails to create debug build of Qt projects on mingw

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P3: Somewhat important
    • 5.0.0
    • 4.7.0
    • Build tools: qmake
    • None
    • Fedora 14 with the Fedora MinGW cross-compiler toolchain (which uses the mingw.org toolchain, but the problem also occurs with the mingw-w64 toolchain)

    Description

      Hi,

      I'm (one of the) package maintainers of the mingw32-qt package on Fedora. This is a cross-compiled version of Qt which allows people to create Win32 binaries on a Linux environment.
      The build script used for this package can be found at http://pkgs.fedoraproject.org/gitweb/?p=mingw32-qt.git;a=blob_plain;f=mingw32-qt.spec;hb=HEAD

      One of our users has reported a bug to us. He tried to generate a debug build of his project. Unfortunately the compilation failed with an error. Here are the steps to reproduce:

      $ cat main.cpp 
      #include <QtCore/QCoreApplication>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
      
          return a.exec();
      }
      
      $ cat qt_test.pro
      QT       += core
      QT       -= gui
      
      TARGET = qt_test
      CONFIG   += console
      CONFIG   -= app_bundle
      
      TEMPLATE = app
      
      SOURCES += main.cpp
      
      $ qmake-qt4 -spec win32-g++-fedora-cross qt_test.pro && make debug
      make -f Makefile.Debug
      make[1]: Entering directory `/home/erik/qt_test'
      i686-pc-mingw32-g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,console -mthreads -Wl -o debug/qt_test.exe debug/main.o  -L'/usr/i686-pc-mingw32/sys-root/mingw/lib' -lQtCore4d 
      /usr/lib64/gcc/i686-pc-mingw32/4.5.1/../../../../i686-pc-mingw32/bin/ld: cannot find -lQtCore4d
      collect2: ld returned 1 exit status
      make[1]: *** [debug/qt_test.exe] Error 1
      make[1]: Leaving directory `/home/erik/qt_test'
      make: *** [debug] Error 2
      

      As you can see qmake has created a Makefile which tries to link against libQtCore4d.a. Unfortunately, this file wasn't created during the compilation of Qt.
      However, a file named libQtCored4.a does get created (notice the 'd4' versus the '4d' which the Makefile is referring to).
      All other files generated by the Qt build scripts also use the 'd4' suffix.

      The Qt MinGW bundle as published on http://qt.nokia.com/downloads/windows-cpp also contains files which contain the 'd4' suffix.

      My question is whether this is a bug in the Qt build system, in one of the qmake mkspecs files or in our packaging?

      The qmake.conf belonging to the mkspecs name win32-g++-fedora-cross can be found at http://pkgs.fedoraproject.org/gitweb/?p=mingw32-qt-qmake.git;a=blob_plain;f=qmake.conf;hb=HEAD

      Attachments

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

        Activity

          People

            buddenha Oswald Buddenhagen
            epienbroek Erik van Pienbroek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes