Can't build Inkscape with GCC 6 using c++14

Bug #1524838 reported by Martin Liska
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
Alex Henrie

Bug Description

Using GCC 6 (pre-release candidate), I get:

g++ -DHAVE_CONFIG_H -I. -I.. -I../cxxtest -I./extension/dbus -I/usr/include/freetype2 -DPOTRACE=\"potrace\" -pthread -I/usr/include/gtkmm-2.4 -I/usr/lib64/gtkmm-2.4/include -I/usr/include/atkmm-1.6 -I/usr/include/gtk-unix-print-2.0 -I/usr/include/gtk-2.0 -I/usr/include/gdkmm-2.4 -I/usr/lib64/gdkmm-2.4/include -I/usr/include/giomm-2.4 -I/usr/lib64/giomm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/lib64/pangomm-1.4/include -I/usr/include/glibmm-2.4 -I/usr/lib64/glibmm-2.4/include -I/usr/include/cairomm-1.0 -I/usr/lib64/cairomm-1.0/include -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -pthread -I/usr/include/cairomm-1.0 -I/usr/lib64/cairomm-1.0/include -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/giomm-2.4 -I/usr/lib64/giomm-2.4/include -I/usr/include/glibmm-2.4 -I/usr/lib64/glibmm-2.4/include -I/usr/include/libpng16 -I/usr/include/libxml2 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include -DG_DISABLE_DEPRECATED -DGLIBMM_DISABLE_DEPRECATED -DGDKMM_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_DEPRECATED -DGTKMM_DISABLE_DEPRECATED -DWITH_LPETOOL -DLPE_ENABLE_TEST_EFFECTS -DWITH_MESH -DWITH_CSSBLEND -DWITH_CSSCOMPOSITE -DWITH_SVG2 -Werror=format-security -Wswitch -Werror=return-type -DGSEAL_ENABLE -DG_DISABLE_SINGLE_INCLUDES -Wall -Wformat -Wformat-security -W -D_FORTIFY_SOURCE=2 -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch -Wno-unused-parameter -flto=9 -O2 -fopenmp -MT ui/dialog/new-from-template.o -MD -MP -MF $depbase.Tpo -c -o ui/dialog/new-from-template.o ui/dialog/new-from-template.cpp &&\
mv -f $depbase.Tpo $depbase.Po
ui/dialog/layer-properties.cpp: In member function ‘void Inkscape::UI::Dialogs::LayerPropertiesDialog::_close()’:
ui/dialog/layer-properties.cpp:149:0: error: call of overloaded ‘ptr_fun(<unresolved overloaded function type>)’ is ambiguous
             sigc::bind(sigc::ptr_fun(&::operator delete), this),

In file included from /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:8:0,
                 from /usr/include/sigc++-2.0/sigc++/functors/slot.h:7,
                 from /usr/include/sigc++-2.0/sigc++/signal_base.h:27,
                 from /usr/include/sigc++-2.0/sigc++/signal.h:8,
                 from /usr/include/sigc++-2.0/sigc++/sigc++.h:86,
                 from /usr/include/glibmm-2.4/glibmm/threads.h:57,
                 from /usr/include/glibmm-2.4/glibmm.h:89,
                 from /usr/include/gtkmm-2.4/gtkmm/dialog.h:7,
                 from ui/dialog/layer-properties.h:19,
                 from ui/dialog/layer-properties.cpp:16:
/usr/include/sigc++-2.0/sigc++/functors/ptr_fun.h:471:1: note: candidate: sigc::pointer_functor1<T_arg1, T_return> sigc::ptr_fun(T_return (*)(T_arg1)) [with T_arg1 = void*; T_return = void]
 ptr_fun(T_return (*_A_func)(T_arg1))
 ^~~~~~~

/usr/include/sigc++-2.0/sigc++/functors/ptr_fun.h:493:1: note: candidate: sigc::pointer_functor3<T_arg1, T_arg2, T_arg3, T_return> sigc::ptr_fun(T_return (*)(T_arg1, T_arg2, T_arg3)) [with T_arg1 = void*; T_arg2 = long unsigned int; T_arg3 = const std::nothrow_t&; T_return = void]
 ptr_fun(T_return (*_A_func)(T_arg1, T_arg2, T_arg3))
 ^~~~~~~

depbase=`echo ui/dialog/ocaldialogs.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\

Where delete operator looks as follows:
inline void operator delete(void *mem, Inkscape::GC::Delete) {
    Inkscape::GC::Core::free(mem);
}

Thanks,
Martin

=====
$ uname -a
Linux marxinbox 4.3.0-2-default #1 SMP PREEMPT Sat Nov 14 16:19:19 UTC 2015 (734b32c) x86_64 x86_64 x86_64 GNU/Linux

Inkscape 0.91+devel r14504

Tags: build
Revision history for this message
su_v (suv-lp) wrote :

Please add details about OS/platform and Inkscape version (0.91 r13725 from tarball, or current trunk (which revision)) to the bug description, thank you.

--
replaces comment 1 to fix typo in revision number

Changed in inkscape:
status: New → Incomplete
tags: added: build
Changed in inkscape:
importance: Undecided → High
Revision history for this message
Martin Liska (mliska) wrote :

Sorry for forgetting that:

$ uname -a
Linux marxinbox 4.3.0-2-default #1 SMP PREEMPT Sat Nov 14 16:19:19 UTC 2015 (734b32c) x86_64 x86_64 x86_64 GNU/Linux

$ git log | head

commit 2369139de0201160b49089051392fac30beb2d76
Merge: 2c226c0 26aac0d
Author: Full Decent <email address hidden>
Date: Fri Dec 4 15:01:43 2015 -0500

    Merge branch 'master' of github.com:inkscape/inkscape

Revision history for this message
su_v (suv-lp) wrote :

On 2015-12-10 15:09 (+0100), Martin Liska wrote:
> $ git log | head
>
> commit 2369139de0201160b49089051392fac30beb2d76
> Merge: 2c226c0 26aac0d
> Author: Full Decent <email address hidden>
> Date: Fri Dec 4 15:01:43 2015 -0500
>
> Merge branch 'master' of github.com:inkscape/inkscape

Just a note - that repo at github is not an official Inkscape mirror (nor is the "inkscape" group at github affiliated in any way with the Inkscape project). AFAICT the repository has a rewritten commit history as well as a changed file structure.

Based on the commit logs of that personal mirror, the build was based on bzr <lp:inkscape> rev 14504.

Changed in inkscape:
status: Incomplete → New
description: updated
Revision history for this message
Martin Liska (mliska) wrote :

Ah, you are right, thanks for identifying the correct revision.

Martin

Revision history for this message
Jonathan Underwood (jonathan-underwood) wrote :

Using gcc 6 on Fedora rawhide, the build of 0.91 release bails at:

ui/dialog/layer-properties.cpp: In member function 'void Inkscape::UI::Dialogs::LayerPropertiesDialog::_close()':
ui/dialog/layer-properties.cpp:149:56: error: call of overloaded 'ptr_fun(<unresolved overloaded function type>)' is ambiguous
             sigc::bind(sigc::ptr_fun(&::operator delete), this),
                                                        ^
In file included from /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:8:0,
                 from /usr/include/sigc++-2.0/sigc++/functors/slot.h:7,
                 from /usr/include/sigc++-2.0/sigc++/signal_base.h:27,
                 from /usr/include/sigc++-2.0/sigc++/signal.h:8,
                 from /usr/include/sigc++-2.0/sigc++/sigc++.h:86,
                 from /usr/include/glibmm-2.4/glibmm/signalproxy.h:12,
                 from /usr/include/glibmm-2.4/glibmm/objectbase.h:23,
                 from /usr/include/glibmm-2.4/glibmm/wrap.h:23,
                 from /usr/include/glibmm-2.4/glibmm/containerhandle_shared.h:25,
                 from /usr/include/glibmm-2.4/glibmm/arrayhandle.h:23,
                 from /usr/include/glibmm-2.4/glibmm.h:91,
                 from /usr/include/gtkmm-2.4/gtkmm/dialog.h:7,
                 from ui/dialog/layer-properties.h:23,
                 from ui/dialog/layer-properties.cpp:16:
/usr/include/sigc++-2.0/sigc++/functors/ptr_fun.h:471:1: note: candidate: sigc::pointer_functor1<T_arg1, T_return> sigc::ptr_fun(T_return (*)(T_arg1)) [with T_arg1 = void*; T_return = void]
 ptr_fun(T_return (*_A_func)(T_arg1))
 ^~~~~~~
/usr/include/sigc++-2.0/sigc++/functors/ptr_fun.h:493:1: note: candidate: sigc::pointer_functor3<T_arg1, T_arg2, T_arg3, T_return> sigc::ptr_fun(T_return (*)(T_arg1, T_arg2, T_arg3)) [with T_arg1 = void*; T_arg2 = long unsigned int; T_arg3 = const std::nothrow_t&; T_return = void]
 ptr_fun(T_return (*_A_func)(T_arg1, T_arg2, T_arg3))
 ^~~~~~~
Makefile:8045: recipe for target 'ui/dialog/layer-properties.o' failed

Revision history for this message
Mc (mc...) wrote :

From https://gcc.gnu.org/gcc-6/changes.html i remark that
"The default mode for C++ is now -std=gnu++14 instead of -std=gnu++98"

The build system and code are mostly untested with c++14*; does it work for you adding --std=gnu++11 ?

* (it _does_ build for me with g++5.3.1 and std=gnu++14 (cmake build [does it work better ?]; i only get deprecated warnings [maybe one of your "DISABLE_DEPRECATED" flags conflicts with it ?] for auto_ptr ), so it might be something else entirely, yet it was the most obvious thing i could think of; )

Here:
libgtkmm 1:2.24.4-2+b1
libglibmm 2.46.3-1
libsigc++ 2.6.2-1
Linux 4.3.0-1-amd64 Debian (testing) 4.3.3-7 x86_64

my build line :
/usr/bin/c++ -DHAVE_CAIRO_PDF=1 -DHAVE_CONFIG_H -DHAVE_POTRACE -DHAVE_TR1_UNORDERED_SET -DORBIT2=1 -D_FORTIFY_SOURCE=2 -I/home/mc/inkscape2/base/inkscape/src -I/home/mc/inkscape2/base/inkscape -I/home/mc/inkscape2/base/inkscape/include -isystem /usr/include/gsl -isystem /usr/include/gnome-vfs-2.0 -isystem /usr/include/gc -isystem /usr/include/poppler -isystem /usr/include/cairo -isystem /usr/include/libwpg-0.3 -isystem /usr/include/librevenge-0.0 -isystem /usr/include/libvisio-0.1 -isystem /usr/include/libcdr-0.1 -isystem /usr/include/gtk-2.0 -isystem /usr/include/gdkmm-2.4 -isystem /usr/include/gdk-pixbuf-2.0 -isystem /usr/lib/x86_64-linux-gnu/gtk-2.0/include -isystem /usr/lib/x86_64-linux-gnu/gdkmm-2.4/include -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem /usr/include/glibmm-2.4 -isystem /usr/lib/x86_64-linux-gnu/glibmm-2.4/include -isystem /usr/include/gtkmm-2.4 -isystem /usr/lib/x86_64-linux-gnu/gtkmm-2.4/include -isystem /usr/include/atk-1.0 -isystem /usr/include/atkmm-1.6 -isystem /usr/include/pango-1.0 -isystem /usr/include/pangomm-1.4 -isystem /usr/lib/x86_64-linux-gnu/pangomm-1.4/include -isystem /usr/include/cairomm-1.0 -isystem /usr/lib/x86_64-linux-gnu/cairomm-1.0/include -isystem /usr/include/giomm-2.4 -isystem /usr/lib/x86_64-linux-gnu/giomm-2.4/include -isystem /usr/include/sigc++-2.0 -isystem /usr/lib/x86_64-linux-gnu/sigc++-2.0/include -isystem /usr/include/freetype2 -isystem /usr/include/gtkspell-2.0 -isystem /usr/include/libxml2 -isystem /usr/include/ImageMagick-6 -isystem /usr/include/x86_64-linux-gnu/ImageMagick-6 -std=gnu++14 -fopenmp -g -o CMakeFiles/inkscape_base.dir/live_effects/lpe-rough-hatches.cpp.o -c /home/mc/inkscape2/base/inkscape/src/live_effects/lpe-rough-hatches.cpp

i will try again with gcc6 once it's available in debian testing...

Revision history for this message
Jonathan Underwood (jonathan-underwood) wrote :

Full build logs for 0.91 and GCC6, which shows a number of warnings which could be bugs here:

https://kojipkgs.fedoraproject.org/work/tasks/4258/12994258/build.log

Revision history for this message
Jonathan Underwood (jonathan-underwood) wrote :

The build in comment #8 was with --std=c++11. Without that, the build fails, as seen here:

https://kojipkgs.fedoraproject.org//work/tasks/3582/12993582/build.log

Mc (mc...)
summary: - Can't build Inkscape with GCC 6: error: call of overloaded
- ‘ptr_fun(<unresolved overloaded function type>)’ is ambiguous
+ Can't build Inkscape with GCC 6 using c++14
Revision history for this message
Mc (mc...) wrote :

I just merged a fix by Alex Henrie in rev 15017, can you test that it also fixes the problem in Fedora ?

Changed in inkscape:
assignee: nobody → Alex Henrie (alexhenrie24)
status: New → In Progress
status: In Progress → Fix Committed
Changed in inkscape:
milestone: none → 0.92
Revision history for this message
Martin Liska (mliska) wrote :

I can confirm that it works on openSUSE Tumbleweed with 6.1.1

Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.