Build failure in widgets/sp-color-wheel-selector.cpp

Bug #747512 reported by Dmitry Dzhus on 2011-04-01
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
High
Alex Valavanis

Bug Description

Revision 9942 (http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/9942) added code relying on certain functions declared in <gtk/gtkhsv.h> header without including the header itself, which results in the following build error:

  CXX widgets/sp-color-wheel-selector.o
widgets/sp-color-wheel-selector.cpp:138:22: error: missing binary operator before token "("
widgets/sp-color-wheel-selector.cpp:223:22: error: missing binary operator before token "("
widgets/sp-color-wheel-selector.cpp: In function 'void resizeHSVWheel(GtkHSV*, GtkAllocation*)':
widgets/sp-color-wheel-selector.cpp:135:42: error: 'gtk_hsv_set_metrics' was not declared in this scope
widgets/sp-color-wheel-selector.cpp: In member function 'virtual void ColorWheelSelector::init()':
widgets/sp-color-wheel-selector.cpp:169:26: error: 'gtk_hsv_new' was not declared in this scope
widgets/sp-color-wheel-selector.cpp:170:40: error: 'GTK_HSV' was not declared in this scope
widgets/sp-color-wheel-selector.cpp:170:49: error: 'gtk_hsv_set_metrics' was not declared in this scope
widgets/sp-color-wheel-selector.cpp: In member function 'virtual void ColorWheelSelector::_colorChanged()':
widgets/sp-color-wheel-selector.cpp:275:82: error: 'gtk_rgb_to_hsv' was not declared in this scope
widgets/sp-color-wheel-selector.cpp:276:42: error: 'GTK_HSV' was not declared in this scope
widgets/sp-color-wheel-selector.cpp:276:53: error: 'gtk_hsv_set_color' was not declared in this scope
widgets/sp-color-wheel-selector.cpp: In static member function 'static void ColorWheelSelector::_wheelChanged(GtkHSV*, SPColorWheelSelector*)':
widgets/sp-color-wheel-selector.cpp:351:40: error: 'gtk_hsv_get_color' was not declared in this scope
widgets/sp-color-wheel-selector.cpp:356:39: error: 'gtk_hsv_to_rgb' was not declared in this scope
widgets/sp-color-wheel-selector.cpp:367:94: error: 'gtk_hsv_is_adjusting' was not declared in this scope
make[3]: *** [widgets/sp-color-wheel-selector.o] Error 1

The proposed solution is including <gtk/gtk.h> in widgets/sp-color-wheel-selector.cpp. Top-level includes are preferred by Gtk+ (see http://library.gnome.org/misc/release-notes/2.24/#rndevelopers)

Gtk+ version 2.24.3, gtkmm 2.24.0.

Related branches

Dmitry Dzhus (dzhus) wrote :
su_v (suv-lp) wrote :

Please add information about the system the build failure occurs on (linux distro, version).

Likely related:
Bug #709847 in Inkscape: “build failed on svg-view.cpp”

See also:
<http://article.gmane.org/gmane.comp.graphics.inkscape.devel/35710>

su_v (suv-lp) wrote :

Also reported on inkscape-devel for Gentoo Linux ~amd64:
<http://article.gmane.org/gmane.comp.graphics.inkscape.devel/35594>

Dmitry Dzhus (dzhus) wrote :

I'm experiencing this problem on Gentoo Linux ~x86. Yes, these bugs are related.

Explicit header dependencies fix the problem in bug #709847 but not here since <gtk/gtkhsv.h> has protection from direct inclusion. I think Gtk+ developers aim to adopt top-level-inclusion-only scheme for future releases of Gtk+.

There might be more places in Inkscape sources where a migration to top-level inclusion may be needed in foreseeable future, paving way to eventual migration to third version of Gtk+.

su_v (suv-lp) wrote :

> (…) a migration to top-level inclusion may be needed (…)

Reading e.g. the commit log of r8278 [1], this seems to be a known or recurring issue…

[1] «Newer GTK is more restrictive with includes, only <gtk/gtk.h> can be directly included now.»
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/8278>

su_v (suv-lp) wrote :

Setting status to 'Confirmed' based on the same build failure having been reported in 'inkscape-devel' (comment #3).

Changed in inkscape:
importance: Undecided → High
status: New → Confirmed
Changed in inkscape:
status: Confirmed → Triaged
assignee: nobody → Alex Valavanis (valavanisalex)
status: Triaged → In Progress
milestone: none → 0.49
Changed in inkscape:
milestone: 0.49 → 0.48.2
Changed in inkscape:
status: In Progress → Fix Committed
su_v (suv-lp) wrote :

inkscape trunk: r10255
inkscape 0.48.x: r9783

Ted Gould (ted) on 2011-09-07
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers