Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.apps > #796

Re: Beyond gtk_init_check() - how do I tell if GTK is installed?

From Jerry Peters <jerry@example.invalid>
Newsgroups comp.os.linux.development.apps
Subject Re: Beyond gtk_init_check() - how do I tell if GTK is installed?
Date 2015-10-01 20:12 +0000
Organization A noiseless patient Spider
Message-ID <muk43g$5vj$1@dont-email.me> (permalink)
References <muikms0poe@news3.newsguy.com>

Show all headers | View raw


Charlie Gibbs <cgibbs@kltpzyxm.invalid> wrote:
> 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...
> 

Read up on dlopen & friends.

Back to comp.os.linux.development.apps | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Beyond gtk_init_check() - how do I tell if GTK is installed? Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2015-10-01 06:43 +0000
  Re: Beyond gtk_init_check() - how do I tell if GTK is installed? Richard Kettlewell <rjk@greenend.org.uk> - 2015-10-01 09:30 +0100
    Re: Beyond gtk_init_check() - how do I tell if GTK is installed? Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2015-10-01 18:00 +0000
      Re: Beyond gtk_init_check() - how do I tell if GTK is installed? Richard Kettlewell <rjk@greenend.org.uk> - 2015-10-01 19:36 +0100
        Re: Beyond gtk_init_check() - how do I tell if GTK is installed? Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2015-10-01 23:39 +0000
          Re: Beyond gtk_init_check() - how do I tell if GTK is installed? Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2015-10-01 19:27 -0600
            Re: Beyond gtk_init_check() - how do I tell if GTK is installed? Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2015-10-02 16:50 +0000
          Re: Beyond gtk_init_check() - how do I tell if GTK is installed? Richard Kettlewell <rjk@greenend.org.uk> - 2015-10-02 09:27 +0100
            Re: Beyond gtk_init_check() - how do I tell if GTK is installed? Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2015-10-02 16:50 +0000
  Re: Beyond gtk_init_check() - how do I tell if GTK is installed? Jerry Peters <jerry@example.invalid> - 2015-10-01 20:12 +0000
    Re: Beyond gtk_init_check() - how do I tell if GTK is installed? Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2015-10-01 23:39 +0000
      Re: Beyond gtk_init_check() - how do I tell if GTK is installed? Jasen Betts <jasen@xnet.co.nz> - 2015-10-02 19:52 +0000
        Re: Beyond gtk_init_check() - how do I tell if GTK is installed? Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2015-10-02 20:13 +0000
      Re: Beyond gtk_init_check() - how do I tell if GTK is installed? Jerry Peters <jerry@example.invalid> - 2015-10-02 20:08 +0000
  Re: Beyond gtk_init_check() - how do I tell if GTK is installed? Jasen Betts <jasen@xnet.co.nz> - 2015-10-02 19:38 +0000

csiph-web