GNOME Bugzilla – Bug 123082
directfb build
Last modified: 2005-02-01 19:35:36 UTC
Like Win32, gtk+(2.2.2) compiled with a target of linux-fb or directfb (via a DirectFB patch) does not have GtkSocket or GtkPlug, because they are specific to X11. If one compiles gtkmm (2.2.x) against gtk+ (made with one of the above targets), it will error out on "make" with the following: g++ -g -O2 -Wall -o .libs/generate_extra_defs generate_defs_gtk.o -Wl,--export-dynamic ./.libs/libgtkmm_generate_extra_defs-2.0.so -L/usr/local//lib -L/usr/local/lib /usr/local//lib/libsigc-1.2.so /usr/local//lib/libgtk-directfb-2.0.so /usr/local//lib/libgdk-directfb-2.0.so /usr/lib/libatk-1.0.so /usr/local//lib/libgdk_pixbuf-2.0.so -lm /usr/local/lib/libdirectfb.so -lpthread /usr/lib/libpangoft2-1.0.so /usr/lib/libpango-1.0.so /usr/lib/libgobject-2.0.so /usr/lib/libgmodule-2.0.so -ldl /usr/lib/libglib-2.0.so -Wl,--rpath -Wl,/usr/local//lib -Wl,--rpath -Wl,/usr/local/lib generate_defs_gtk.o(.text+0x4f8): In function `main': /home/pgasper/files/DirectFB-cvs-91803/gtkmm-2.2.3/tools/extra_defs_gen/generate_defs_gtk.cc:49: undefined reference to `gtk_socket_get_type' generate_defs_gtk.o(.text+0x61e):/home/pgasper/files/DirectFB-cvs-91803/gtkmm-2.2.3/tools/extra_defs_gen/generate_defs_gtk.cc:49: undefined reference to `gtk_plug_get_type' collect2: ld returned 1 exit status make[3]: *** [generate_extra_defs] Error 1 make[3]: Leaving directory `/home/pgasper/files/DirectFB-cvs-91803/gtkmm-2.2.3/tools/extra_defs_gen' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/pgasper/files/DirectFB-cvs-91803/gtkmm-2.2.3/tools' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/pgasper/files/DirectFB-cvs-91803/gtkmm-2.2.3' make: *** [all] Error 2 The following mailing list messages also reference this problem: http://www.geocrawler.com/mail/msg.php3?msg_id=8355709&list=1110 http://mail.gnome.org/archives/gtkmm-list/2003-June/msg00182.html Solution: To successfully compile, the following lines in gtk/gtkmm/wrapper_init.cc (gtkmm-2.2.7) need to be ifndef'ed for linux-fb or DirectFB, like they are for WIN32: 206, 448 (for gtk_socket_get_type) 190, 432 (for gtk_plug_get_type) This worked successfully on my machine under gtkmm-2.2.3 (my devel version) but I see no reason it won't work under 2.2.7. I would submit a patch (the fix in wrapper_init.cc is simple enough), but I have no clue as to where/how the checks happen for detirmining the gtk+ target and doing a #define accordingly. For certain this needs to be fixed for linux-fb. Not so clear as to how to accomplish for DirectFB, since it is a patch and won't be officially supported in Gtk+ till version 2.6. The fix for directfb might be correctly accomplished by a patch in the DirectFB project or, a gtkmm or DirectFB FAQ entry.
> but I > have no clue as to where/how the checks happen for detirmining the > gtk+ > target and doing a #define accordingly. I would expect there to be a #define in gtk+ already, that we could just use. I would like you to investigate this. I think it's a fairly generic problem. For DirectFB, we could have a patch while GTK+ has a patch, and support it properly when GTK+ supports it properly.
I think this is it: found in gdktypes.h: /* The system specific file gdkconfig.h contains such configuration * settings that are needed not only when compiling GDK (or GTK) * itself, but also occasionally when compiling programs that use GDK * (or GTK). One such setting is what windowing API backend is in use. */ gdkconfig.h is found in lib/gtk-2.0/include/ where lib is in the prefix directory (usually /usr or /usr/local). inside gdkconfig.h is a #define which identifies the windowing API backend. It is #define GDK_WINDOWING_* where * is X11, FB, WIN32 or (with the directfb patch) DIRECTFB. The gtk+/gdk patch for directfb is maintained by the DirectFB project currently. Right now I'm not entirly certain if my solution (with respect to wrapper_init.cc) is correct (I can't replicate it), but its a good example of what needs to be done.
Yes, I think GDK_WINDOWING_FB is what you are looking for. I think you mean wrap_init.cc, rather than wrapper_init.cc. wrap_init.cc is a generated file, so you need to create some way to say, in the .hg source file, that there should be an #ifdef in the wrap_init.cc file. This has already been done for Win32. For instance, see the _GTKMMPROC_WIN32_NO_WRAP macro in gtk/src/socket.hg, and the resultant #ifdefs in gtk/gtkmm/wrap_init.cc. I don't remember exactly how it's implemented, but grep should be helpful.
Do you need more help with this?
Should I close this bug report?
I am now using gtkmm under XWindows so this bug no longer affects me so I am not working on it. I wouldn't close it though because AFAIK this bug prevents anyone from compiling gtkmm against a gtk+ which was compiled against linux-fb or directfb.
I'm closing this because nobody is actually experiencing this problem. If anybody needs the clues then they will find this bugzilla bug via search engines.