Re: need help with compiling with GTK+2.0 (updated)

From: Christopher Nehren (apeiron+usenet_at_coitusmentis.info)
Date: 12/15/04


Date: 15 Dec 2004 02:24:43 GMT


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2004-12-15, Call me Stupid scribbled these
curious markings:
> Hi all,
>
> I have this tiny tiny program, which (1) when compiled as ....
>
> $> gcc -Wall -g example.c -o example `pkg-config --cflags --libs
> gtk+-2.0` -lgtk -lgdk
>
> ... compile well and then (2) when run, generates bus error at
>
> window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
>
> (3) the same program works if GTK+1.2 is used instead of GTK+2.0
>

I'm going to guess that you're using a binary package based-Linux (as
you gave no hint as to your operating platform in either of your posts),
since that seems to be The Cool Thing for Geeks that every geek uses if
they want to Be Cool, and because you use -lgtk and -lgdk which implies
non-versioned installations of the GTK+ libraries which assumes that
you'll only ever have one version of those libraries installed, which is
the assumption that many Linux distributions seem to be in the habit of
making (completely neglecting the existence of many fine GTK+ 1.x
applications that are much better than any GTK+ 2.x replacement, such as
XMMS)[1]. If this is incorrect, I'll ecstatically welcome a correction.

If this is the case, then did you perhaps install a version of the GTK+
libraries which are incompatible with your hardware architecture? This
is often the cause of 'illegal instruction' errors as you posted in your
previous post. If you compiled your libraries from source with the
proper compiler flags, then you wouldn't have this (and probably many
other (but I digress)) problem(s).

Do other applications linked against the same version of the GTK+ 2.x
libraries work? The sample application that you provided compiles and
runs fine for me (modulo the Lunixisms I described above), so it's
(probably) not a code issue. I'm running GTK+ 2.5.6.

1: Holy Unbounded Run-on, Batman!

Best Regards,
Christopher Nehren
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (FreeBSD)

iD8DBQFBv6Brk/lo7zvzJioRAmteAKCplJiRjBRlxLgB6HNpt8KHEmBLewCggMM2
bWV9DLKLJfYehSEVrXoQHEk=
=EMv9
-----END PGP SIGNATURE-----

-- 
I abhor a system designed for the "user", if that word is a coded
pejorative meaning "stupid and unsophisticated".  -- Ken Thompson
If you ask the wrong questions, you get answers like "42" and "God".
Unix is user friendly. However, it isn't idiot friendly.


Relevant Pages

  • Re: ML vs. Lisp
    ... would be better off writing *ML, or are you being ironic again? ... Look at LAPACK, FFTW, GLU and GTK from OCaml for example. ... I don't use many C libraries and the ones ... Use a common language run time like .NET. ...
    (comp.lang.functional)
  • Newbie building from source. Gtk-config not helping.
    ... Pretty much a fresh install ... Thing is, Gtk+ 1.2.10nb5 is there for all to see, as shown in the ... checking for C compiler default output... ... gtk+-1.2.10nb5 The GIMP Toolkit - libraries for building X11 user ...
    (comp.unix.bsd.netbsd.misc)
  • Re: gtk+ on embedded device
    ... > Gtk+ installation means to cross compile a lot ... > of libraries, ... > an easier way to install gtk+ using framebuffer ... But when I have to install the ...
    (comp.os.linux.embedded)
  • Re: D7 or D7+KYLIX or KYLIX ?
    ... It would be the same with wxWidget and gtk+ ... You can write a solid executable but then you can only use C libraries ... The gcc 3.x has an ABI (application ... binary interface) that could be emulated by a Delphi class. ...
    (borland.public.delphi.non-technical)
  • Re: Xlib Binding or Re-implementation?
    ... >> What is it that you don't like about Gtk? ... It's that GUI libraries for 'nix, ... don't encourage good GUI design principles. ... else must use Ada. ...
    (comp.lang.ada)