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

Error building QTestCase under MingW

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P1: Critical
    • None
    • 5.15.0 Beta1
    • Core: Threads
    • None
    • 64-bit MingW 8.3 on Ubuntu
    • All

    Description

      Received the following while building qt-5.15.0-beta. I was able to temporarily resolve it by switching to posix (instead of Windows) threads ($ sudo update-alternatives --config x86_64-w64-mingw32-g++), but didn't have to do that with the 5.12-5.14 releases. My cross compiler is a bit slow, so it'll be several hours before I'll know if the pthreads fix works.

      x86_64-w64-mingw32-g++ -c -include .pch/QtTestDepends -pipe -fno-keep-inline-dllexport -Os -std=c++1z -fexceptions -mthreads -Wall -Wextra -Wextra -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow -ffunction-sections -fdata-sections -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_FOREACH -DQT_NO_DATASTREAM -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_TESTLIB_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_NO_DEBUG -DQT_CORE_LIB -I. -I../../include -I../../include/QtTest -I../../include/QtTest/5.15.0 -I../../include/QtTest/5.15.0/QtTest -Itmp -I../../include/QtCore/5.15.0 -I../../include/QtCore/5.15.0/QtCore -I../../include/QtCore -I.moc -I/home/squinky86/w64/openssl-1.1.1d/include -I../../mkspecs/win32-g++  -o .obj/qtestcase.o qtestcase.cpp
      In file included from ../../include/QtCore/5.15.0/QtCore/private/qwaitcondition_p.h:1,
                       from qtestcase.cpp:62:
      ../../include/QtCore/5.15.0/QtCore/private/../../../../../src/corelib/thread/qwaitcondition_p.h:144:20: error: 'mutex' in namespace 'std' does not name a type
       using mutex = std::mutex;
                          ^~~~~
      ../../include/QtCore/5.15.0/QtCore/private/../../../../../src/corelib/thread/qwaitcondition_p.h:144:15: note: 'std::mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
      ../../include/QtCore/5.15.0/QtCore/private/../../../../../src/corelib/thread/qwaitcondition_p.h:59:1:
      +#include <mutex>
       #include <mutex>
      ../../include/QtCore/5.15.0/QtCore/private/../../../../../src/corelib/thread/qwaitcondition_p.h:144:15:
       using mutex = std::mutex;
                     ^~~
      ../../include/QtCore/5.15.0/QtCore/private/../../../../../src/corelib/thread/qwaitcondition_p.h:145:33: error: 'condition_variable' in namespace 'std' does not name a type
       using condition_variable = std::condition_variable;
                                       ^~~~~~~~~~~~~~~~~~
      ../../include/QtCore/5.15.0/QtCore/private/../../../../../src/corelib/thread/qwaitcondition_p.h:145:28: note: 'std::condition_variable' is defined in header '<condition_variable>'; did you forget to '#include <condition_variable>'?
      ../../include/QtCore/5.15.0/QtCore/private/../../../../../src/corelib/thread/qwaitcondition_p.h:59:1:
      +#include <condition_variable>
       #include <mutex>
      ../../include/QtCore/5.15.0/QtCore/private/../../../../../src/corelib/thread/qwaitcondition_p.h:145:28:
       using condition_variable = std::condition_variable;
                                  ^~~
      qtestcase.cpp:1015:46: error: 'mutex' is not a member of 'QtPrivate'
           bool waitFor(std::unique_lock<QtPrivate::mutex> &m, Expectation e) {
                                                    ^~~~~
      qtestcase.cpp:1015:51: error: template argument 1 is invalid
           bool waitFor(std::unique_lock<QtPrivate::mutex> &m, Expectation e) {
                                                         ^
      qtestcase.cpp:1080:16: error: 'mutex' in namespace 'QtPrivate' does not name a type
           QtPrivate::mutex mutex;
                      ^~~~~
      qtestcase.cpp:1081:16: error: 'condition_variable' in namespace 'QtPrivate' does not name a type
           QtPrivate::condition_variable waitCondition;
                      ^~~~~~~~~~~~~~~~~~
      qtestcase.cpp: In member function 'bool QTest::WatchDog::waitFor(int&, QTest::WatchDog::Expectation)':
      qtestcase.cpp:1019:20: error: 'waitCondition' was not declared in this scope
                   return waitCondition.wait_for(m, defaultTimeout(), expectationChanged);
                          ^~~~~~~~~~~~~
      qtestcase.cpp:1019:20: note: suggested alternative: 'QWaitCondition'
                   return waitCondition.wait_for(m, defaultTimeout(), expectationChanged);
                          ^~~~~~~~~~~~~
                          QWaitCondition
      qtestcase.cpp: In constructor 'QTest::WatchDog::WatchDog()':
      qtestcase.cpp:1033:38: error: 'mutex' was not declared in this scope
               auto locker = qt_unique_lock(mutex);
                                            ^~~~~
      qtestcase.cpp:1033:38: note: suggested alternative: 'QMutex'
               auto locker = qt_unique_lock(mutex);
                                            ^~~~~
                                            QMutex
      qtestcase.cpp: In destructor 'virtual QTest::WatchDog::~WatchDog()':
      qtestcase.cpp:1040:48: error: 'mutex' was not declared in this scope
                   const auto locker = qt_scoped_lock(mutex);
                                                      ^~~~~
      qtestcase.cpp:1040:48: note: suggested alternative: 'QMutex'
                   const auto locker = qt_scoped_lock(mutex);
                                                      ^~~~~
                                                      QMutex
      qtestcase.cpp:1042:13: error: 'waitCondition' was not declared in this scope
                   waitCondition.notify_all();
                   ^~~~~~~~~~~~~
      qtestcase.cpp:1042:13: note: suggested alternative: 'QWaitCondition'
                   waitCondition.notify_all();
                   ^~~~~~~~~~~~~
                   QWaitCondition
      qtestcase.cpp: In member function 'void QTest::WatchDog::beginTest()':
      qtestcase.cpp:1048:44: error: 'mutex' was not declared in this scope
               const auto locker = qt_scoped_lock(mutex);
                                                  ^~~~~
      qtestcase.cpp:1048:44: note: suggested alternative: 'QMutex'
               const auto locker = qt_scoped_lock(mutex);
                                                  ^~~~~
                                                  QMutex
      qtestcase.cpp:1050:9: error: 'waitCondition' was not declared in this scope
               waitCondition.notify_all();
               ^~~~~~~~~~~~~
      qtestcase.cpp:1050:9: note: suggested alternative: 'QWaitCondition'
               waitCondition.notify_all();
               ^~~~~~~~~~~~~
               QWaitCondition
      qtestcase.cpp: In member function 'void QTest::WatchDog::testFinished()':
      qtestcase.cpp:1054:44: error: 'mutex' was not declared in this scope
               const auto locker = qt_scoped_lock(mutex);
                                                  ^~~~~
      qtestcase.cpp:1054:44: note: suggested alternative: 'QMutex'
               const auto locker = qt_scoped_lock(mutex);
                                                  ^~~~~
                                                  QMutex
      qtestcase.cpp:1056:9: error: 'waitCondition' was not declared in this scope
               waitCondition.notify_all();
               ^~~~~~~~~~~~~
      qtestcase.cpp:1056:9: note: suggested alternative: 'QWaitCondition'
               waitCondition.notify_all();
               ^~~~~~~~~~~~~
               QWaitCondition
      qtestcase.cpp: In member function 'virtual void QTest::WatchDog::run()':
      qtestcase.cpp:1060:38: error: 'mutex' was not declared in this scope
               auto locker = qt_unique_lock(mutex);
                                            ^~~~~
      qtestcase.cpp:1060:38: note: suggested alternative: 'QMutex'
               auto locker = qt_unique_lock(mutex);
                                            ^~~~~
                                            QMutex
      qtestcase.cpp:1062:9: error: 'waitCondition' was not declared in this scope
               waitCondition.notify_all();
               ^~~~~~~~~~~~~
      qtestcase.cpp:1062:9: note: suggested alternative: 'QWaitCondition'
               waitCondition.notify_all();
               ^~~~~~~~~~~~~
               QWaitCondition
      Makefile:1944: recipe for target '.obj/qtestcase.o' failed
      make[2]: *** [.obj/qtestcase.o] Error 1
      make[2]: Leaving directory '/home/squinky86/w64/qtbase-everywhere-src-5.15.0-beta1/src/testlib'
      Makefile:383: recipe for target 'sub-testlib-make_first' failed
      make[1]: *** [sub-testlib-make_first] Error 2
      make[1]: Leaving directory '/home/squinky86/w64/qtbase-everywhere-src-5.15.0-beta1/src'
      Makefile:53: recipe for target 'sub-src-make_first' failed
      make: *** [sub-src-make_first] Error 2
      
      $ x86_64-w64-mingw32-g++ --version
      x86_64-w64-mingw32-g++ (GCC) 8.3-win32 20190406
      

      Attachments

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

        Activity

          People

            kkohne Kai Köhne
            squinky86 Jon Hood
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes