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

Debug build of application with cmake loads debug and release Qt libraries (was: QApplication::applicationDirPath() empty in debug cmake build)

    XMLWordPrintable

Details

    • macOS
    • be21ff11b7c25e3f6682c7987052557eca48e907 (qt/qtbase/5.13) afec5935ea811755c14683a162868b1a5cfb7ed5 (qt/qtbase/5.12)

    Description

      Problem:
      the call 'QApplication::applicationDirPath()' is always empty for 'debug'-only build of cmake projects.

      How to reproduce it:

      • create via QtCreator menu new project, application, widget-type, cmake-based build
      • open generated main.cpp and after QApplication app definition insert this line:
        qDebug() << "=== app path:" << QApplication::applicationDirPath(); 
      • compile and start

      Observed:

      • non-debug builds are OK
      • Qt 5.12.x get proper result for debug build as well
      • 5.13.1 debug build output is:
      objc[83404]: Class QMacAutoReleasePoolTracker is implemented in both /Users/xxx/dev/sdk/Qt/5.13.1/clang_64/lib/QtCore.framework/Versions/5/QtCore (0x104a4d6b0) and /Users/xxx/dev/sdk/Qt/5.13.1/clang_64/lib/QtCore.framework/Versions/5/QtCore_debug (0x103d451e8). One of the two will be used. Which one is undefined.
      objc[83404]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /Users/xxx/dev/sdk/Qt/5.13.1/clang_64/lib/QtCore.framework/Versions/5/QtCore (0x104a4d728) and /Users/xxx/dev/sdk/Qt/5.13.1/clang_64/lib/QtCore.framework/Versions/5/QtCore_debug (0x103d45260). One of the two will be used. Which one is undefined.
      objc[83404]: Class KeyValueObserver is implemented in both /Users/xxx/dev/sdk/Qt/5.13.1/clang_64/lib/QtCore.framework/Versions/5/QtCore (0x104a4d750) and /Users/xxx/dev/sdk/Qt/5.13.1/clang_64/lib/QtCore.framework/Versions/5/QtCore_debug (0x103d45288). One of the two will be used. Which one is undefined.
      objc[83404]: Class RunLoopModeTracker is implemented in both /Users/xxx/dev/sdk/Qt/5.13.1/clang_64/lib/QtCore.framework/Versions/5/QtCore (0x104a4d7a0) and /Users/xxx/dev/sdk/Qt/5.13.1/clang_64/lib/QtCore.framework/Versions/5/QtCore_debug (0x103d452d8). One of the two will be used. Which one is undefined.
      QCoreApplication::applicationDirPath: Please instantiate the QApplication object first
       === app path: ""
      • I tried to trigger clean command line build only (i.e. without QtCreator) and I got the same result
      • following these steps for console application instead of widget one for Qt 5.13.1; the output of applicationDirPath is correct in debug (no warning in console)
      • Qt 5.13.0 widget app (installed via HomeBrew) is working for debug OK

      Expected: debug macOS build return valid app dir path

      Attachments

        Issue Links

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

          Activity

            People

              alexandru.croitor Alexandru Croitor
              horar Lubomir Carik
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes