Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

"This file requires support for the ISO C++ 2011 standard."

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
curmudgeon
Veteran
Veteran
Posts: 1746
Joined: Fri Aug 08, 2003 1:39 pm

"This file requires support for the ISO C++ 2011 standa

  • Quote

Post by curmudgeon » Tue Oct 30, 2018 4:33 am

I suppose I could stick this in "Unsupported Software," since I am using the last stable version of Mumble, but I am going to post this here anyway. :) I don't expect the developers to fix this since it involves a package removed from the tree, but an explanation (for my own edification) and suggestions for ways to work around it would be appreciated.

I have kept ebuilds for the last stable version of Mumble (and its dependencies not required by any other packages) in a local overlay. So dev-libs/protobuf-3.61 was recently marked stable (from 3.5.2 as the previously newest stable ebuild), and since 3.6.1 contains newer versions of libprotobuf, libprotobuf-lite, and libprotoc, that upgrade required a rebuild of Mumble, which failed (with the relevant part of the build log shown below).

Code: Select all

In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/g++-v7/mutex:35:0,
                 from /usr/include/google/protobuf/stubs/mutex.h:33,
                 from /usr/include/google/protobuf/stubs/common.h:52,
                 from Mumble.pb.h:9,
                 from Mumble.pb.cc:4:
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/g++-v7/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^~~~~
compilation terminated due to -Wfatal-errors.
make[1]: *** [Makefile:2532: Mumble.pb.o] Error 1
make[1]: *** Waiting for unfinished jobs....
GlobalShortcut_unix.cpp: In member function 'virtual QString GlobalShortcutX::buttonName(const QVariant&)':
GlobalShortcut_unix.cpp:340:79: warning: 'KeySym XKeycodeToKeysym(Display*, KeyCode, int)' is deprecated [-Wdeprecated-declarations]
   KeySym ks=XKeycodeToKeysym(QX11Info::display(), static_cast<KeyCode>(key), 0);
I rolled back dev-libs/protobuf to 3.52, and then Mumble compiled as before (although it was no longer necessary to recompile it, other than to verify that it was protobuf, instead of any of the other upgrades, that is causing this problem).

I have never seen an error message like this before, and wonder if someone can explain to me what is going on.
Top
fedeliallalinea
Administrator
Administrator
User avatar
Posts: 31985
Joined: Sat Mar 08, 2003 11:15 pm
Location: here
Contact:
Contact fedeliallalinea
Website

  • Quote

Post by fedeliallalinea » Tue Oct 30, 2018 6:43 am

But mumble already exists in tree

Code: Select all

$ eix mumble
* media-sound/mumble
     Available versions:  **9999 {+alsa +dbus debug g15 jack libressl +opus oss pch portaudio pulseaudio +rnnoise speech zeroconf}
     Homepage:            https://wiki.mumble.info
     Description:         Mumble is an open source, low-latency, high quality voice chat software
anyway try the related patch https://github.com/mumble-voip/mumble/c ... 4bddffd3cd
Questions are guaranteed in life; Answers aren't.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Top
curmudgeon
Veteran
Veteran
Posts: 1746
Joined: Fri Aug 08, 2003 1:39 pm

  • Quote

Post by curmudgeon » Tue Oct 30, 2018 11:07 pm

Yes, I know there is still a snapshot ebuild in portage, but I have tended to avoid those, mostly because they are non-reproducible (the source can be different every time you build againts it).

That commit you referred to is dated 2016-11-13 (and 1.2.19 was released on 2017-01-27), so I believe that it was already included (and even updated) in the last release.

Code: Select all

diff from_commit.text mumble-1.2.19/cplusplus.pri
36,56d35
<       # For the c++1z and c++14 cases below, we also
<       # add the prior "modern" standards to CONFIG.
<       #
<       # This is because Qt 5.6 (and maybe earlier
<       # versions) use the presence of CONFIG(c++11)
<       # to mean "modern C++".
<       #
<       # For example, Qt 5.6's
<       # mkspecs/features/qt_module_headers.prf
<       # file will automatically add -std=c++98 to
<       # CXXFLAGS if CONFIG(c++11) isn't set.
<       #
<       # The result is that if we ONLY put c++1z in
<       # CONFIG, that check will cause us to have
<       # *both* -std=c++98 *and* -std=gnu++1z in
<       # CXXFLAGS when building on Qt 5.6, which
<       # is bad.
<       #
<       # In order to be compatible with such checks,
<       # ensure that we have all prior "modern"
<       # C++ standards in CONFIG, to please Qt.
59,60d37
<               # Add prior modern standards...
<               CONFIG *= c++11 c++14
63,64d39
<               # Add prior modern standards...
<               CONFIG *= c++11
74a50,78
> # If CONFIG(c++1z) or CONFIG(c++14) is set, we
> # also add the prior "modern" standards to
> # CONFIG.
> #
> # This is because Qt 5.6 (and maybe earlier
> # versions) use the presence of CONFIG(c++11)
> # to mean "modern C++".
> #
> # For example, Qt 5.6's
> # mkspecs/features/qt_module_headers.prf
> # file will automatically add -std=c++98 to
> # CXXFLAGS if CONFIG(c++11) isn't set.
> #
> # The result is that if we ONLY put c++1z in
> # CONFIG, that check will cause us to have
> # *both* -std=c++98 *and* -std=gnu++1z in
> # CXXFLAGS when building on Qt 5.6, which
> # is bad.
> #
> # In order to be compatible with such checks,
> # ensure that we have all prior "modern"
> # C++ standards in CONFIG, to please Qt.
> CONFIG(c++1z) {
>       CONFIG *= c++11 c++14
> }
> CONFIG(c++14) {
>       CONFIG *= c++11
> }
> 
116c120
<               MULTIARCH_TRIPLE = $$system($${QMAKE_CC} -print-multiarch)
---
>               MULTIARCH_TRIPLE = $$system($${QMAKE_CC} -print-multiarch 2>/dev/null)
118c122,133
<                       QMAKE_LIBDIR *= /usr/lib/$${MULTIARCH_TRIPLE}/c++11
---
>                       # Don't add the Debian-specfic c++11 libdir when using
>                       # a Mumble buildenv.
>                       #
>                       # Adding this directory to QMAKE_LIBDIR this early in
>                       # the build process will  cause Mumble to prefer this
>                       # lib dir to the buildenv's own.
>                       # The easiest way to fix this is to simply avoid adding
>                       # this dir when building using a Mumble buildenv, since
>                       # it is irrelevant for us in that setting.
>                       !CONFIG(buildenv) {
>                               QMAKE_LIBDIR *= /usr/lib/$${MULTIARCH_TRIPLE}/c++11
>                       }
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Wed Oct 31, 2018 1:21 am

As regards explaining the error message:

C++11 introduced new language features and new standard library features. Some of those standard library features require the new language features to be enabled. For the case of <mutex>, it uses explicitly deleted member functions. The syntax for that feature is a parse error in C++03 and below, but valid in C++11 and above. To prevent strange and confusing error messages, the gcc developers arranged that trying to include <mutex> while using C++03 or below would give the error you posted, instead of failing with a syntax error.

You can work around that error by enabling C++11 mode for the source file that includes that protobuf header. That might cause errors elsewhere if Mumble uses constructs that are valid C++03 and invalid C++11. That is generally quite rare, though.
Top
curmudgeon
Veteran
Veteran
Posts: 1746
Joined: Fri Aug 08, 2003 1:39 pm

  • Quote

Post by curmudgeon » Sat Nov 03, 2018 9:24 pm

Thanks for the reply.

I am trying to go through this, and am still (more than) a bit confused.

Are you saying I need to modify the Mumble source, even though it was protobuf that changed (works with the old protobuf, but not the new one)?

I am also having trouble locating the Mumble file referenced in the error messages above. If I look in the source tarball and search for "Mumble," I get only two hits:

Code: Select all

mumble-1.2.19/macx/osax/MumbleOverlay.sdef
mumble-1.2.19/src/Mumble.proto
There is nothing about Mumble.pb.cc or Mumble.pb.h.

And if I look in the build log for "Mumble," I get:

Code: Select all

make[1]: Entering directory '/var/tmp/portage/media-sound/mumble-1.2.19/work/mumble-1.2.19/src/mumble'
protoc --cpp_out=. -I. -I.. ../Mumble.proto
/usr/lib64/qt4/bin/uic ConfigDialog.ui -o ui_ConfigDialog.h
[libprotobuf WARNING /var/tmp/portage/dev-libs/protobuf-3.6.1/work/protobuf-3.6.1/src/google/protobuf/compiler/parser.cc:562] No syntax specified for the proto file: Mumble.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)

[...]

x86_64-pc-linux-gnu-g++ -c -march=native -O2 -pipe -std=c++98 -Wfatal-errors -fvisibility=hidden -Wshadow -Woverloaded-virtual -Wold-style-cast -Wconversion -Wsign-compare -Wall -Wextra -Wall -W -D_REENTRANT -DPLUGIN_PATH=/usr/lib64/mumble -DRESTRICT=__restrict__ -D_FORTIFY_SOURCE=2 -DMUMBLE_VERSION_STRING=1.2.19 -DMUMBLE -DNO_CRASH_REPORT -DUSE_OPUS -DUSE_ALSA -DUSE_DBUS -DNO_UPDATE_CHECK -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtSvg -I/usr/include/qt4 -I/usr/include/qt4/QtDBus -I../../src -I. -I../bonjour -I../../celt-0.7.0-src/libcelt -I. -I/usr/include/opus -I/usr/include/alsa -I. -o Mumble.pb.o Mumble.pb.cc
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/g++-v7/mutex:35:0,
                 from /usr/include/google/protobuf/stubs/mutex.h:33,
                 from /usr/include/google/protobuf/stubs/common.h:52,
                 from Mumble.pb.h:9,
                 from Mumble.pb.cc:4:
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/g++-v7/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and libra
ry support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^~~~~
compilation terminated due to -Wfatal-errors.
make[1]: *** [Makefile:2532: Mumble.pb.o] Error 1
make[1]: *** Waiting for unfinished jobs....
The last match includes the error messages included in my first post.

Normally, I can track the chain of included fairly easily, but I am lost in this case.
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Nov 03, 2018 11:22 pm

Mumble.pb.cc is a generated file. It is written by a protobuf tool, then compiled by your C++ compiler, at which point it then requires C++11 support because of how protobuf is written. You need to modify the Mumble build process, not the Mumble source files, to specify the newer standard. Something is explicitly selecting a very old standard (-std=c++98). Find and eliminate that, and the default should be new enough for protobuf to work.
Top
Post Reply

6 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic