VLC and Qt5.7.0 and c++11

*nix specific usage questions
fuantaji
New Cone
New Cone
Posts: 2
Joined: 28 Apr 2016 12:41

VLC and Qt5.7.0 and c++11

Postby fuantaji » 28 Apr 2016 13:07

I've moved my Gentoo system to Qt 5.7.0_beta and was rebuilding world when the process failed on vlc-2.2.2

#include <QApplication> failes:
In file included from qt4.cpp:29:
In file included from /usr/include/qt5/QtWidgets/QApplication:1:
In file included from /usr/include/qt5/QtWidgets/qapplication.h:43:
In file included from /usr/include/qt5/QtCore/qcoreapplication.h:43:
In file included from /usr/include/qt5/QtCore/qglobal.h:1140:
In file included from /usr/include/qt5/QtCore/qatomic.h:46:
/usr/include/qt5/QtCore/qbasicatomic.h:61:4: error: "Qt requires C++11 support"
# error "Qt requires C++11 support"
As stated on https://wiki.qt.io/New_Features_in_Qt_5.7
New Features in Qt 5.7
C++11 Support Required from the compiler
Qt has enabled usage of C++11 in Qt applications for a long time, but with Qt 5.7 we are also enabling use of C++11 in the Qt modules. Therefore Qt 5.7 requires C++11 support from the compiler, and has removed support from older compilers not providing adequate C++11 support.
So I have created a temp env file for vlc package and added --std=c++11 there
cat /etc/portage/env/media-video/vlc
CXXFLAGS="${CFLAGS} --std=c++11"
Now Clang-3.8 gives me
demux/mkv/mkv.cpp:463:65: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
msg_Dbg( p_demux, "lengthy way of seeking for pos:%"PRId64, i_pos );
After fixing this type of errors (adding space in front PRId64) others popped up.

GCC-4.9.3 gives me
In file included from /usr/include/qt5/QtCore/qatomic_cxx11.h:45:0,
from /usr/include/qt5/QtCore/qbasicatomic.h:53,
from /usr/include/qt5/QtCore/qatomic.h:46,
from /usr/include/qt5/QtCore/qglobal.h:1140,
from /usr/include/qt5/QtCore/qchar.h:43,
from /usr/include/qt5/QtCore/qstring.h:48,
from /usr/include/qt5/QtCore/QString:1,
from qt4.hpp:37,
from main_interface.cpp:30:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/atomic:866:25: error: macro "atomic_compare_exchange_weak_explicit" passed 5 arguments, but takes just 4
memory_order __m2) noexcept
Has anyone built vlc with c++11 on?

Rémi Denis-Courmont
Developer
Developer
Posts: 15318
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: VLC and Qt5.7.0 and c++11

Postby Rémi Denis-Courmont » 28 Apr 2016 13:15

Yes.

But it looks like your Qt and GCC versions are incompatible.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

fuantaji
New Cone
New Cone
Posts: 2
Joined: 28 Apr 2016 12:41

Re: VLC and Qt5.7.0 and c++11

Postby fuantaji » 28 Apr 2016 13:20

Yes.

But it looks like your Qt and GCC versions are incompatible.
Qt and almost everything else is built with Clang-3.8 on my system.
I've just tried building vlc with gcc-4.9.3 just in case.

NofanTasi
New Cone
New Cone
Posts: 9
Joined: 20 Nov 2013 16:47

Re: VLC and Qt5.7.0 and c++11

Postby NofanTasi » 30 Sep 2016 23:23

I have similar issues on gentoo building vlc-2.2.4 for qt-5.7.0 using gcc-5.4.0.
either I get

Code: Select all

# error "Qt requires C++11 support"
or, with --std=c++11 (and qt rebuilt as such) I get

Code: Select all

"atomic_compare_exchange_weak_explicit" passed 5 arguments, but takes just 4
How do I know if Qt and GCC versions are incompatible?
@fuantaji: did you get around issue?
Thanks

Rémi Denis-Courmont
Developer
Developer
Posts: 15318
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: VLC and Qt5.7.0 and c++11

Postby Rémi Denis-Courmont » 01 Oct 2016 01:41

You need VLC 3.0 to compile in C++11 mode.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

NofanTasi
New Cone
New Cone
Posts: 9
Joined: 20 Nov 2013 16:47

Re: VLC and Qt5.7.0 and c++11

Postby NofanTasi » 01 Oct 2016 15:05

thanks!


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 37 guests