Charlie Gibbs
2015-10-01 06:43:40 UTC
I've started learning how to write GTK code. One thing I noticed is
that where gtk_init() will terminate your program if it can't find a
display, gtk_init_check() will tell you whether it succeeded and let
you use other means (e.g. curses or a text-based interface) if not.
I've written a test program that uses this technique, and it works
fine - at least as long as GTK is installed. However, if GTK is
not installed, my program dies instantly. I think it's because it
can't find needed dynamic libraries; however, the machine on which
I tested it belongs to someone else who's now gone, and all of my
machines already have GTK installed so I can't easily reproduce the
condition.
In a perfect world, gtk_init_check() would contain enough statically
linked code that it could test for the presence of the GTK libraries
and return an appropriate error if they're absent. But I guess I'll
have to settle for some sort of programmatic test for the existence
of these libraries that won't nuke my program if they're not there.
Is there a way to do this? Can I coax the system to start executing
my program and not insist on the presence of dynamic libraries before
I need them, so I can check whether they're available? And how can I
check whether they're available?
aTdHvAaNnKcSe for any advice...
that where gtk_init() will terminate your program if it can't find a
display, gtk_init_check() will tell you whether it succeeded and let
you use other means (e.g. curses or a text-based interface) if not.
I've written a test program that uses this technique, and it works
fine - at least as long as GTK is installed. However, if GTK is
not installed, my program dies instantly. I think it's because it
can't find needed dynamic libraries; however, the machine on which
I tested it belongs to someone else who's now gone, and all of my
machines already have GTK installed so I can't easily reproduce the
condition.
In a perfect world, gtk_init_check() would contain enough statically
linked code that it could test for the presence of the GTK libraries
and return an appropriate error if they're absent. But I guess I'll
have to settle for some sort of programmatic test for the existence
of these libraries that won't nuke my program if they're not there.
Is there a way to do this? Can I coax the system to start executing
my program and not insist on the presence of dynamic libraries before
I need them, so I can check whether they're available? And how can I
check whether they're available?
aTdHvAaNnKcSe for any advice...
--
/~\ ***@kltpzyxm.invalid (Charlie Gibbs)
\ / I'm really at ac.dekanfrus if you read it the right way.
X Top-posted messages will probably be ignored. See RFC1855.
/ \ HTML will DEFINITELY be ignored. Join the ASCII ribbon campaign!
/~\ ***@kltpzyxm.invalid (Charlie Gibbs)
\ / I'm really at ac.dekanfrus if you read it the right way.
X Top-posted messages will probably be ignored. See RFC1855.
/ \ HTML will DEFINITELY be ignored. Join the ASCII ribbon campaign!