Project

General

Profile

Bug #556

audacious.pc.in missing -std=c++11

Added by Martin Kelly over 8 years ago. Updated over 8 years ago.

Status:
Rejected
Priority:
Minor
Assignee:
-
Category:
-
Target version:
-
Start date:
July 04, 2015
Due date:
% Done:

0%

Estimated time:
Affects version:

Description

Hi,

I'm trying to compile the imms audacious plugin against the latest audacious (d55d76a, slightly after audacious-3.7-alpha1). While doing this, I'm getting a failure in the ./configure step because libaudcore requires C++ 2011 support but doesn't ask for it in its PKG_CONFIG. The attached patch corrects this; assuming you see no issues, please merge it.

Failure:
configure:5966: g++ -c -g -O2 -pthread -I/home/martin/Desktop/audacious/include -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include conftest.cpp >&5
In file included from /usr/include/c++/4.9/type_traits:35:0,
from /home/martin/Desktop/audacious/include/libaudcore/templates.h:24,
from /home/martin/Desktop/audacious/include/libaudcore/index.h:23,
from /home/martin/Desktop/audacious/include/libaudcore/plugins.h:23,
from /home/martin/Desktop/audacious/include/libaudcore/plugin.h:25,
from conftest.cpp:66:
/usr/include/c++/4.9/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

add-std-c-11-to-pkgconfig.patch (786 Bytes) add-std-c-11-to-pkgconfig.patch Martin Kelly, July 04, 2015 04:23

History

#1 Updated by John Lindgren over 8 years ago

  • Status changed from New to Rejected

I think adding -std=c++11 to audacious.pc is a bad idea. In particular, it would break any plugins (or other library headers) that might need to be compiled with e.g. -std=gnu++11 or -std=c++14. Just add -std=c++11 to your CXXFLAGS for the plugin.

#2 Updated by Martin Kelly over 8 years ago

That's true; I hadn't thought about it. Unfortunately, we'll implicitly requiring C++ 11 for anyone using the audacious libraries, and breaking them if their code doesn't work with it. I don't see a good solution to this.

#3 Updated by John Lindgren over 8 years ago

Adding "-std=c++11" to a Makefile takes less than a minute, and in my experience, most C++98/03 will compile as C++11 without any changes. So I don't see the problem with requiring C++11.

Obviously, for plugins that are actually written in a different language (not C++), it will be necessary to have some "bridge" code: probably just a single C++ file that calls out to the rest of the plugin. This is nothing new; in Audacious 3.5 and earlier, our headers required C99, and any plugin written in C++ had to have one C file with the plugin declaration in it, which would call out to a bunch of extern "C" functions in the rest of the plugin.

Also available in: Atom PDF