Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest Qt requires -std=c++14 #12645

Closed
parkerlreed opened this issue Jul 12, 2021 · 3 comments
Closed

Latest Qt requires -std=c++14 #12645

parkerlreed opened this issue Jul 12, 2021 · 3 comments

Comments

@parkerlreed
Copy link

Description

Compile fails with Qt enabled with this error. After searching, it appears std::exchange was introduced in c++14 although RetroArch seems to use c++11 by default.

/usr/include/qt/QtCore/qsharedpointer_impl.h: In function ‘std::shared_ptr<_Tp> qobject_pointer_cast(std::shared_ptr<_Tp>&&)’:
/usr/include/qt/QtCore/qsharedpointer_impl.h:1019:40: error: ‘exchange’ is not a member of ‘std’
 1019 |         return std::shared_ptr<X>(std::exchange(src, nullptr), castResult);
      |                                        ^~~~~~~~
CXX ui/drivers/qt/qt_options.cpp
In file included from /usr/include/qt/QtCore/qsharedpointer.h:48,
                 from /usr/include/qt/QtCore/qdebug.h:54,
                 from /usr/include/qt/QtCore/qcborcommon.h:45,
                 from /usr/include/qt/QtCore/qcborvalue.h:45,
                 from /usr/include/qt/QtCore/qcborarray.h:43,
                 from /usr/include/qt/QtCore/QtCore:38,
                 from /usr/include/qt/QtWidgets/QtWidgetsDepends:3,
                 from /usr/include/qt/QtWidgets/QtWidgets:3,
                 from ui/drivers/ui_qt.cpp:19:
/usr/include/qt/QtCore/qsharedpointer_impl.h: In function ‘std::shared_ptr<_Tp> qobject_pointer_cast(std::shared_ptr<_Tp>&&)’:
/usr/include/qt/QtCore/qsharedpointer_impl.h:1019:40: error: ‘exchange’ is not a member of ‘std’
 1019 |         return std::shared_ptr<X>(std::exchange(src, nullptr), castResult);
      |                                        ^~~~~~~~
In file included from /usr/include/qt/QtCore/qsharedpointer.h:48,
                 from /usr/include/qt/QtGui/qpixmap.h:48,
                 from /usr/include/qt/QtGui/qbrush.h:52,
                 from /usr/include/qt/QtGui/qpalette.h:46,
                 from /usr/include/qt/QtWidgets/qwidget.h:48,
                 from /usr/include/qt/QtWidgets/qdialog.h:44,
                 from /usr/include/qt/QtWidgets/qprogressdialog.h:45,
                 from /usr/include/qt/QtWidgets/QProgressDialog:1,
                 from ui/drivers/qt/qt_downloads.cpp:3:

Expected behavior

Qt bits compile

Actual behavior

Qt bits don't compile and abort entire build

Steps to reproduce the bug

  1. Compile RetroArch on defaults
  2. Observe error

Version/Commit

You can find this information under Information/System Information

Environment information

  • OS: Arch Linux
  • Compiler: gcc 11.1.0-1

qt5-base 5.15.2+kde+r209-1

@parkerlreed
Copy link
Author

I've attempted to use CXXFLAGS+=" -std=c++14" before the configure but it still seems to force c++11 (as noted in the configure output)

@parkerlreed
Copy link
Author

qt5-base updated and the compile now works.

qt5-base-5.15.2+kde+r210-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant