Building the trunk on Gentoo. Compile problems with GTK
Hi,
I'm getting this compile error on Gentoo:
svg-view.cpp: In member function ‘virtual void SPSVGView::mouseover()’: svg-view.cpp:114:40: error: ‘GDK_HAND2’ was not declared in this scope svg-view.cpp:114:49: error: ‘gdk_cursor_new’ was not declared in this scope svg-view.cpp:115:70: error: ‘GTK_WIDGET’ was not declared in this scope svg-view.cpp:115:87: error: ‘gdk_window_set_cursor’ was not declared in this scope 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.
On IRC, user su-v suggested it might be related to this: https://bugs.launchpad.net/ubuntu/+source/claws-mail/+bug/247909/comments/12
I think this requires a code fix.
Cheers,
Alex.
Emerging (1 of 1) media-gfx/inkscape-9999 from Alexander
* Package: media-gfx/inkscape-9999 * USE: amd64 dia elibc_glibc inkjar kernel_linux lcms multilib nls postscript spell userland_GNU wmf * FEATURES: preserve-libs sandbox splitdebug
Unpacking source...
* bzr update start --> * repository: lp:inkscape Tree is up to date at revision 9995. * exporting ... ============================================================================= When you report a trouble about building BZR version of inkscape, Please report following information about distro and tools version, too.
--1. distribution------------------------------------------------------------ Gentoo Base System release 2.0.1
--2. tools------------------------------------------------------------------- /usr/bin/m4: m4 (GNU M4) 1.4.15 /usr/bin/autoconf: autoconf (GNU Autoconf) 2.65 /usr/bin/autoheader: autoheader (GNU Autoconf) 2.65 /usr/bin/automake: automake (GNU automake) 1.11.1 automake-1.7: not found automake-1.8: not found /usr/bin/automake-1.9: Useless use of /d modifier in transliteration operator at /usr/share/automake-1.9/Automake/Wrap.pm line 60. automake (GNU automake) 1.9.6 /usr/bin/aclocal: aclocal (GNU automake) 1.11.1 aclocal-1.7: not found aclocal-1.8: not found /usr/bin/aclocal-1.9: aclocal (GNU automake) 1.9.6 /usr/bin/intltoolize: intltoolize (GNU intltool) 0.41.1 /usr/bin/gettextize: /usr/bin/gettextize (GNU gettext-tools) 0.18.1
--3. environment variables--------------------------------------------------- LDFLAGS=-Wl,-O1 -Wl,--as-needed LDFLAGS_default= PORTAGE_PYM_PATH=/usr/lib64/portage/pym PRELINK_PATH_MASK=/usr/lib64/libfreebl3.so:/usr/lib64/libnssdbm3.so:/usr/lib64/libsoftokn3.so CFLAGS_default= ASFLAGS_x86=--32 PROFILE_PATHS=/usr/portage/profiles/base PORTAGE_BIN_PATH=/usr/lib64/portage/bin CXXFLAGS=-march=athlon64 -O2 -pipe PATH=/usr/lib64/portage/bin/ebuild- helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64- pc-linux-gnu/gcc-bin/4.5.2 LANG=en_GB.UTF-8 DCCC_PATH=/usr/lib64/distcc/bin LANGUAGE= CFLAGS=-march=athlon64 -O2 -pipe LDFLAGS_x86=-m elf_i386 CFLAGS_x86=-m32 ROOTPATH=/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.2 USB_DEVFS_PATH=/dev/bus/usb
=============================================================================
I am testing that you have the required versions of autoconf, automake, glib-gettextize and intltoolize. This test is not foolproof and if anything goes wrong, there may be guidance in the file HACKING.txt
checking for autoconf >= 2.52 ... yes (version 2.65) checking for automake >= 1.10 ... yes (version 1.11.1) checking for glib-gettextize >= 2.0.0 ... yes (version 2.26.1) checking for intltool >= 0.17 ... yes (version 0.41.1)
Running aclocal-1.11 ... Running autoheader ... Running libtoolize ... libtoolize: putting auxiliary files in `.'. libtoolize: linking file `./ltmain.sh' libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and libtoolize: rerunning libtoolize, to keep the correct libtool macros in- tree. libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am. libtoolize: `AC_PROG_RANLIB' is rendered obsolete by `LT_INIT' Running automake-1.11 --copy --force --add-missing ... configure.ac:42: installing `./compile' configure.ac:12: installing `./config.guess' configure.ac:12: installing `./config.sub' configure.ac:14: installing `./install-sh' configure.ac:14: installing `./missing' share/palettes/Makefile.am:36: foreach i,$(palettes_i18n: non-POSIX variable name share/palettes/Makefile.am:36: (probably a GNU make extension) src/Makefile.am: installing `./depcomp' Running autoconf ... Running glib-gettextize --copy --force ... Copying file mkinstalldirs Copying file po/Makefile.in.in Running intltoolize --copy --force --automake ...
Done! Please run './configure' now.
On 5/1/11 15:00, Alexander Wright wrote:
I'm getting this compile error on Gentoo:
svg-view.cpp: In member function ‘virtual void SPSVGView::mouseover()’: svg-view.cpp:114:40: error: ‘GDK_HAND2’ was not declared in this scope svg-view.cpp:114:49: error: ‘gdk_cursor_new’ was not declared in this scope svg-view.cpp:115:70: error: ‘GTK_WIDGET’ was not declared in this scope svg-view.cpp:115:87: error: ‘gdk_window_set_cursor’ was not declared in this scope 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.
On IRC, user su-v suggested it might be related to this: https://bugs.launchpad.net/ubuntu/+source/claws-mail/+bug/247909/comments/12
This was only a guess ;) after a brief google search (I don't code myself and know close to nil about handling includes) - on OS X 10.5.8, building with GCC 4.2.1, GTK+ 2.22.1, GLib 2.26.1 I don't see this build failure, nor do I recall reading similar reports recently about this type of build failure with Inkscape trunk on other systems.
I think this requires a code fix.
On irc you mentioned creating an 'ebuild':
(…) trying to build the repository tip on Gentoo, but am having some problems. I've created an ebuild to correctly fetch the code, and configure, but I'm getting an error (…)
Does creating an ebuild affect running autogen.sh and configure?
~suv
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).
Given that the GTK_WIDGET macro is not defined, try adding <gtk/gtkwidget.h> as an include. For the GDK_HAND2 macro, try adding #include <gdk/gdkcursor.h>
participants (3)
-
Alexander Wright
-
Jon Cruz
-
~suv