Synfig Issue Tracker
star_faded.png
Please log in to bookmark issues
bug_report_small.png
CLOSED  Bug report #904  -  C++11 and libsigc++ 2.6.0 support
Posted Sep 27, 2015 - updated Feb 17, 2016
action_vote_minus_faded.png
2
Votes
action_vote_plus_faded.png
icon_info.png This issue has been closed with status "Fixed" and resolution "RESOLVED".
Issue details
  • Type of issue
    Bug report
  • Status
     
    Fixed
  • Assigned to
    Not assigned to anyone
  • Progress
       
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     Tom
  • Owned by
    Not owned by anyone
  • Category
    Compiling / Packaging
  • Resolution
    RESOLVED
  • Priority
    Not determined
  • Targetted for
    icon_milestones.png Not determined
  • Tags
    icon_customdatatype.png Not determined
  • Difficulty
    icon_customdatatype.png Not determined
Issue description
Last week gnome 3.18.0 was released including new versions of libsigc++, gtkmm etc.

Important here is that all C++ packages require now a C++11 compliant compiler, which means that every software package using them also needs to be written in C++11.

libsigc++, apart from the move to C++11, also went through a number of changes, including the removal of a number of headers.

Long story short: synfig and synfigstudio do not compile anymore against the latest versions of gtkmm and its dependencies.

As contributor of Homebrew I managed to patch both packages to make them work again using the diffs found at:

https://gist.github.com/tschoonj/06d5de3cdc5d063f8612 https://gist.github.com/tschoonj/91fd64c528c7b971f185

You may want to use them in your next release.

Steps to reproduce this issue
Nothing entered.

#2
Comment posted by
 onlyjob
Oct 13, 22:58
Please prioritise this issue as Synfig(Studio) FTBFS in Debian with libsigc++ 2.6.1 and GCC-5.

libtool: compile:  g++ -DHAVE_CONFIG_H -I../.. -I../../src -D_FORTIFY_SOURCE=2 -I/usr/include -I/usr/include/glibmm-2.4 -I/usr/lib/x86_64-linux-gnu/glibmm-2.4/include -I/usr/i
nclude/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sigc++-2.0 -I/usr/lib/x86_64-linux-gnu/sigc++-2.0/include -pthread -I/usr/include/giomm-2.4 -I/usr/
lib/x86_64-linux-gnu/giomm-2.4/include -I/usr/include/glibmm-2.4 -I/usr/lib/x86_64-linux-gnu/glibmm-2.4/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/in
clude -I/usr/include/sigc++-2.0 -I/usr/lib/x86_64-linux-gnu/sigc++-2.0/include -I/usr/include/libxml++-2.6 -I/usr/lib/x86_64-linux-gnu/libxml++-2.6/include -I/usr/include/libx
ml2 -I/usr/include/glibmm-2.4 -I/usr/lib/x86_64-linux-gnu/glibmm-2.4/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sigc++-2.0 -I/
usr/lib/x86_64-linux-gnu/sigc++-2.0/include -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6 -I/usr/include/x86_64-linux-gnu/
/ImageMagick-6 -I/usr/include/ImageMagick-6 -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib
/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pan
go-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -D_RE
ENTRANT -I/usr/include/mlt++ -I/usr/include/mlt -I/usr/include/sigc++-2.0 -I/usr/lib/x86_64-linux-gnu/sigc++-2.0/include -DSYNFIG_NO_DEPRECATED -DLOCALEDIR=\"/usr/share/locale
\" -DLIBDIR=\"/usr/lib/x86_64-linux-gnu\" -DSYSCONFDIR=\"/etc/synfig\" -fstack-protector-strong -Wformat -Werror=format-security -O2 -DNDEBUG -W -Wall -c value.cpp  -fPIC -DPI
C -o .libs/libsynfig_la-value.o
In file included from /usr/include/sigc++-2.0/sigc++/signal_base.h:26:0,
                 from /usr/include/sigc++-2.0/sigc++/signal.h:8,
                 from canvas.h:34,
                 from value.cpp:37:
/usr/include/sigc++-2.0/sigc++/trackable.h:115:3: warning: identifier 'noexcept' is a keyword in C++11 [-Wc++0x-compat]
   trackable(trackable&& src) noexcept;
   ^
In file included from /usr/include/sigc++-2.0/sigc++/signal_base.h:26:0,
                 from /usr/include/sigc++-2.0/sigc++/signal.h:8,
                 from canvas.h:34,
                 from base_types.cpp:37:
/usr/include/sigc++-2.0/sigc++/trackable.h:115:3: warning: identifier 'noexcept' is a keyword in C++11 [-Wc++0x-compat]
   trackable(trackable&& src) noexcept;
   ^
In file included from /usr/include/c++/5/type_traits:35:0,
                 from /usr/include/sigc++-2.0/sigc++/visit_each.h:22,
                 from /usr/include/sigc++-2.0/sigc++/functors/slot.h:6,
                 from /usr/include/sigc++-2.0/sigc++/signal_base.h:27,
                 from /usr/include/sigc++-2.0/sigc++/signal.h:8,
                 from canvas.h:34,
                 from base_types.cpp:37:
/usr/include/c++/5/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.
 #error This file requires compiler and library support for the \
  ^
In file included from /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:7: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 canvas.h:34,
                 from base_types.cpp:37:
/usr/include/sigc++-2.0/sigc++/functors/functor_trait.h:92:3: warning: identifier 'decltype' is a keyword in C++11 [-Wc++0x-compat]
   static int check(X_functor* obj, decltype(&X_functor::operator()) p = nullptr);
   ^
/usr/include/sigc++-2.0/sigc++/functors/functor_trait.h:92:3: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat]


...

#3
Comment posted by
 Konstantin Dmitriev
Oct 14, 10:37
Hello! Thank you for reminder. We will take a look on this.
#5
Comment posted by
 caryoscelus
Nov 11, 17:00
After updating debian (sid), i got another c++11 related problem building synfig:

time.cpp: In member function 'bool synfig::Time::is_valid() const':
time.cpp:322:22: error: call of overloaded 'isnan(const value_type&)' is ambiguous
  return !isnan(value_);
                      ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/c++config.h:482,
                 from /usr/include/c++/5/string:38,
                 from string.h:30,
                 from time.h:31,
                 from time.cpp:35:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:234:1: note: candidate: int isnan(double)
 __MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
 ^
In file included from /usr/local/include/ETL/_misc.h:29:0,
                 from /usr/local/include/ETL/misc:32,
                 from time.cpp:37:
/usr/include/c++/5/cmath:626:3: note: candidate: constexpr bool std::isnan(long double)
   isnan(long double __x)
   ^
/usr/include/c++/5/cmath:622:3: note: candidate: constexpr bool std::isnan(double)
   isnan(double __x)
   ^
/usr/include/c++/5/cmath:618:3: note: candidate: constexpr bool std::isnan(float)
   isnan(float __x)
   ^


Quick search shows that it's a C++11 migration issue that can be fixed by simply replacing isnan occurences with std::isnan.

diff --git a/synfig-core/src/synfig/time.cpp b/synfig-core/src/synfig/time.cpp
index d83f0c5..7d844df 100644
--- a/synfig-core/src/synfig/time.cpp
+++ b/synfig-core/src/synfig/time.cpp
@@ -319,5 +319,5 @@ Time::c_str()const
 bool
 Time::is_valid()const
 {
-       return !isnan(value_);
+       return !std::isnan(value_);
 }


After that, i had also to replace some sigc++ headers (as mentioned in OP).
#7
Comment posted by
 djay
Jan 17, 11:56
tips :

#8
Comment posted by
 djay
icon_reply.pngJan 19, 10:51, in reply to comment #7
how to fix :

General information about C++11 : Stroustrup.b C++11 FAQ

See C++11Support branch for progress
#14
Comment posted by
 djay
icon_reply.pngJan 29, 17:50, in reply to comment #8
Welcome C++11 to master : https://github.com/synfig/synfig/pull/219