Re: Problems with simple examples

GnomeCanvas, though it should still work for existing applications, is considered obsolete today. There are currently several contenders about that desire to become the official GtkCanvas. There is a great overview about them at:

Personally I switched to GooCanvas after having used GnomeCanvas during several years, and I found it great for drawing graphics primitives with interaction.


2009/1/3 Jasper Taylor <jasper simulistics com>
Hello Gtk+ world! I am wanting to learn gtk+ programming, and am having trouble getting the examples from the GGAD book ( working.
I was able to run the 'Hello World' example in Appendix E more or less as described. Although a couple of warnings appeared:

Gtk-WARNING **: Failed to load module "": cannot open shared object file: No such file or directory

Gtk-WARNING **: Failed to load module "": cannot open shared object file: No such file or directory

(Obviously it's nothing so simple as them actually not being there).

But I found that with the GnomeCanvas example (listing on If I just copied and pasted the code, and built it with a similar command line, i.e.,

gcc canvoid.c -o base `pkg-config --cflags --libs gnomeui` builds OK, produces the same two warnings, but hangs, or else goes:
*** glibc detected *** ./base: malloc(): memory corruption (fast): 0x08c81c30 ***
Segmentation fault
...if you jiggle the ellipse items around a lot.

However, if you replace:
#include <gnome.h>
#include <gtk/gtk.h>
#include <libgnomecanvas/libgnomecanvas.h>
and replace
gnome_init("canvas-example", "0.0", argc, argv);
gtk_init(&argc, &argv); get rid of the warnings, and it no longer hangs.

However, the next thing I want to do is put the GnomeCanvas into the application framework from Hello World, and this seems to require that I use gnome.h and the gnomeui library. Thus, the app crashes.

Now I am just starting out with this, but I have trawled this mailing list and the Web in general for any references to similar problems, and can find none -- or at least none with answers. My personal suspicion is that I am falling victim to a vast and unacknowledged incompatibility problem owing to my system (Ubuntu 8.10) having components of both gtk+ 1.2 and 2.0 installed in various places. This does not help me find a solution though!

Can any initiates help me find my way through this minefield?

gtk-list mailing list
gtk-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]