Re: [Inkscape-devel] Building the trunk on Gentoo. Compile problemswith GTK
On Sat, 8 Jan 2011 11:57:21 -0800, Jon Cruz wrote:
On Jan 5, 2011, at 6:00 AM, Alexander Wright wrote:
svg-view.cpp:116:28: error: ‘gdk_cursor_unref’ was not
declared in this scope
svg-view.cpp: In member function ‘virtual void
SPSVGView::mouseout()’:
svg-view.cpp:122:70: error: ‘GTK_WIDGET’ was not declared in
this scope
svg-view.cpp:122:85: error: ‘gdk_window_set_cursor’ was not
declared in this
scope make[3]: *** [svg-view.o] Error 1
Adding #include <gtk/gtk.h> to svg-view.cpp and widgets/sp-color-wheel- selector.cpp fixes the problem.
In general, good practice is to include only the smallest set of
headers that a .cpp file will be consuming. Avoiding "kitchen sink" headers brings many advantages including code clarity, better modularity and encapsulation, faster compile times, etc.
It appears that GTK might be moving away from this. Although adding
<gtk/gtk.h> might help 'unbreak' a compile, I'd see if a few explicit additions can help. (BTW, this is a perfect example of problems due to one include file including other include files). gtk has an explicit goal of only allowing a library's main header to be included. With the exception of one or two oddballs (outside scope of normal gtk and gdk use), <gtk/gtk.h> and <gdk/gdk.h> are the only approved ones for public consumption. See: http://live.gnome.org/GnomeGoals/CleanupGTKIncludes Don't shoot me, I'm just the messenger:) dan -- Daniel Macks dmacks@...2516...
On Jan 9, 2011, at 1:37 AM, Daniel Macks wrote:
gtk has an explicit goal of only allowing a library's main header to be included. With the exception of one or two oddballs (outside scope of normal gtk and gdk use), <gtk/gtk.h> and <gdk/gdk.h> are the only approved ones for public consumption. See:
http://live.gnome.org/GnomeGoals/CleanupGTKIncludes
Don't shoot me, I'm just the messenger:)
Well... yes and no. They've sometimes said some things, but documentation has referenced explicit headers. However, much of this will not change until GTK 3, and many things will break then. Once GTK 3 has managed to be deployed and adopted by distros, Inkscape can look at switching to it.
Then again, their schedules are slipping, so it is a moving target.
participants (2)
-
Daniel Macks
-
Jon Cruz