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

Qt5.15.0 fails to compile hello world with g++ versions 6, 7 and 8 but works with version 9 and 10

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 5.15.0
    • Core: Other
    • None
    • Linux/X11

    Description

      Using Qt5.15.0 and trying to compile the following hello world fails with g++ versions 6, 7 and 8 but works with g++ version 9 and 10. Same hello world with Qt5.14.2 works for all compilers mention above. Below is a log of first trying all compilers with Qt5.15.0 followed by Qt5.14.2.

      Using Qt5.15.0

      $ cat bug.cpp
      #include <QtWidgets/QApplication>
      #include <QtWidgets/QPushButton>
      
      int main( int argc, char **argv ) {
      	QApplication a( argc, argv );
      
      	QPushButton hello( "Hello world!", 0 );
      	hello.resize( 100, 30 );
      
      	hello.show();
      	return a.exec();
      }
      
      
      * Test compilation with g++-6
      
      $ qmake --version
      QMake version 3.1
      Using Qt version 5.15.0 in /usr/lib
      
      $ g++-6 --version
      g++-6 (GCC) 6.5.0
      Copyright (C) 2017 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.  There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      
      
      $ g++-6 -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o bug.o bug.cpp
      
      $ g++-6 -Wl,-O1 -o qtbug bug.o /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Core.so -lGL -lpthread
      ld: /usr/lib/libQt5Widgets.so: undefined reference to `std::pmr::monotonic_buffer_resource::~monotonic_buffer_resource()@GLIBCXX_3.4.28'
      ld: /usr/lib/libQt5Widgets.so: undefined reference to `vtable for std::pmr::monotonic_buffer_resource@GLIBCXX_3.4.28'
      ld: /usr/lib/libQt5Widgets.so: undefined reference to `std::pmr::get_default_resource()@GLIBCXX_3.4.26'
      ld: /usr/lib/libQt5Widgets.so: undefined reference to `std::pmr::monotonic_buffer_resource::_M_new_buffer(unsigned long, unsigned long)@GLIBCXX_3.4.26'
      
      
      * Test compilation with g++-7
      
      $ qmake --version
      QMake version 3.1
      Using Qt version 5.15.0 in /usr/lib
      
      $ g++-7 --version
      g++-7 (GCC) 7.5.0
      Copyright (C) 2017 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.  There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      
      
      $ g++-7 -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o bug.o bug.cpp
      
      $ g++-7 -Wl,-O1 -o qtbug bug.o /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Core.so -lGL -lpthread
      /usr/bin/ld: /usr/lib/libQt5Widgets.so: undefined reference to `std::pmr::monotonic_buffer_resource::~monotonic_buffer_resource()@GLIBCXX_3.4.28'
      /usr/bin/ld: /usr/lib/libQt5Widgets.so: undefined reference to `vtable for std::pmr::monotonic_buffer_resource@GLIBCXX_3.4.28'
      /usr/bin/ld: /usr/lib/libQt5Widgets.so: undefined reference to `std::pmr::get_default_resource()@GLIBCXX_3.4.26'
      /usr/bin/ld: /usr/lib/libQt5Widgets.so: undefined reference to `std::pmr::monotonic_buffer_resource::_M_new_buffer(unsigned long, unsigned long)@GLIBCXX_3.4.26'
      collect2: error: ld returned 1 exit status
      
      
      * Test compilation with g++-8
      
      $ qmake --version
      QMake version 3.1
      Using Qt version 5.15.0 in /usr/lib
      
      $ g++-8 --version
      g++-8 (GCC) 8.4.0
      Copyright (C) 2018 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.  There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      
      
      $ g++-8 -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o bug.o bug.cpp
      
      $ g++-8 -Wl,-O1 -o qtbug bug.o /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Core.so -lGL -lpthread
      /usr/bin/ld: /usr/lib/libQt5Widgets.so: undefined reference to `std::pmr::monotonic_buffer_resource::~monotonic_buffer_resource()@GLIBCXX_3.4.28'
      /usr/bin/ld: /usr/lib/libQt5Widgets.so: undefined reference to `vtable for std::pmr::monotonic_buffer_resource@GLIBCXX_3.4.28'
      /usr/bin/ld: /usr/lib/libQt5Widgets.so: undefined reference to `std::pmr::get_default_resource()@GLIBCXX_3.4.26'
      /usr/bin/ld: /usr/lib/libQt5Widgets.so: undefined reference to `std::pmr::monotonic_buffer_resource::_M_new_buffer(unsigned long, unsigned long)@GLIBCXX_3.4.26'
      collect2: error: ld returned 1 exit status
      
      
      * Test compilation with g++-9
      
      $ qmake --version
      QMake version 3.1
      Using Qt version 5.15.0 in /usr/lib
      
      $ g++-9 --version
      g++-9 (Arch Linux 9.3.0-2) 9.3.0
      Copyright (C) 2019 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.  There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      
      
      $ g++-9 -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o bug.o bug.cpp
      
      $ g++-9 -Wl,-O1 -o qtbug bug.o /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Core.so -lGL -lpthread
      
      
      * Test compilation with g++
      
      $ qmake --version
      QMake version 3.1
      Using Qt version 5.15.0 in /usr/lib
      
      $ g++ --version
      g++ (GCC) 10.1.0
      Copyright (C) 2020 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.  There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      
      
      $ g++ -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o bug.o bug.cpp
      
      $ g++ -Wl,-O1 -o qtbug bug.o /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Core.so -lGL -lpthread
      

       

      Using Qt5.14.2

      $ cat bug.cpp
      #include <QtWidgets/QApplication>
      #include <QtWidgets/QPushButton>
      
      int main( int argc, char **argv ) {
      	QApplication a( argc, argv );
      
      	QPushButton hello( "Hello world!", 0 );
      	hello.resize( 100, 30 );
      
      	hello.show();
      	return a.exec();
      }
      
      
      * Test compilation with g++-6
      
      $ qmake --version
      QMake version 3.1
      Using Qt version 5.14.2 in /usr/lib
      
      $ g++-6 --version
      g++-6 (GCC) 6.5.0
      Copyright (C) 2017 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.  There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      
      
      $ g++-6 -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o bug.o bug.cpp
      
      $ g++-6 -Wl,-O1 -o qtbug bug.o /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Core.so -lGL -lpthread
      
      
      * Test compilation with g++-7
      
      $ qmake --version
      QMake version 3.1
      Using Qt version 5.14.2 in /usr/lib
      
      $ g++-7 --version
      g++-7 (GCC) 7.5.0
      Copyright (C) 2017 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.  There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      
      
      $ g++-7 -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o bug.o bug.cpp
      
      $ g++-7 -Wl,-O1 -o qtbug bug.o /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Core.so -lGL -lpthread
      
      
      * Test compilation with g++-8
      
      $ qmake --version
      QMake version 3.1
      Using Qt version 5.14.2 in /usr/lib
      
      $ g++-8 --version
      g++-8 (GCC) 8.4.0
      Copyright (C) 2018 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.  There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      
      
      $ g++-8 -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o bug.o bug.cpp
      
      $ g++-8 -Wl,-O1 -o qtbug bug.o /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Core.so -lGL -lpthread
      
      
      * Test compilation with g++-9
      
      $ qmake --version
      QMake version 3.1
      Using Qt version 5.14.2 in /usr/lib
      
      $ g++-9 --version
      g++-9 (Arch Linux 9.3.0-2) 9.3.0
      Copyright (C) 2019 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.  There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      
      
      $ g++-9 -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o bug.o bug.cpp
      
      $ g++-9 -Wl,-O1 -o qtbug bug.o /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Core.so -lGL -lpthread
      
      
      * Test compilation with g++
      
      $ qmake --version
      QMake version 3.1
      Using Qt version 5.14.2 in /usr/lib
      
      $ g++ --version
      g++ (GCC) 10.1.0
      Copyright (C) 2020 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.  There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      
      
      $ g++ -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o bug.o bug.cpp
      
      $ g++ -Wl,-O1 -o qtbug bug.o /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Core.so -lGL -lpthread
      

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            niklass Niklas No
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes