Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I am attempting to use Gtk2 to create a user interface with Perl.

I have installed the various dependencies as described in the GTK Perl Tutorial, and continue to be unsucessful. Here is the test code.

#!/usr/bin/perl -w use Gtk; # load the Gtk-Perl module use strict; # a good idea for all +non-trivial Perl scripts set_locale Gtk; # internationalize init Gtk; # initialize Gtk-Perl # convenience variables for true and false my $false = 0; my $true = 1; # widget creation my $window = new Gtk::Window( "toplevel" ); my $button = new Gtk::Button( "Goodbye World" ); # callback registration $window->signal_connect( "delete_event", \&CloseAppWindow ); $button->signal_connect( "clicked", \&CloseAppWindow ); # show button $button->show(); # set window attributes and show it $window->border_width( 15 ); $window->add( $button ); $window->show(); # Gtk event loop main Gtk; # Should never get here exit( 0 ); ### Callback function to close the window sub CloseAppWindow { Gtk->exit( 0 ); return $false; } # END EXAMPLE PROGRAM

When I run this I get the error message

"Can't locate loadable object for module Glib in @INC (@INC contains: /System/Library/Perl/5.8.8/darwin-thread-multi-2level /System/Library/Perl/5.8.8 /System/Library/Perl /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.8 /Library/Perl/Updates/5.8.8 /Library/Perl/5.8.8/darwin-thread-multi-2level /Library/Perl/5.8.8 /Library/Perl /Perl/5.8.8/darwin-thread-multi-2level /Network/Library/Perl/5.8.8 /Network/Library/Perl /Network/Library/Perl/5.8.8/darwin-thread-multi-2level .) at /System/Library/Perl/5.8.8/darwin-thread-multi-2level/Gtk.pm line 30 Compilation failed in require at /System/Library/Perl/5.8.8/darwin-thread-multi-2level/Gtk.pm line 30. BEGIN failed--compilation aborted at /System/Library/Perl/5.8.8/darwin-thread-multi-2level/Gtk.pm line 30. Compilation failed in require at GTK1.pl line 16. BEGIN failed--compilation aborted at GTK1.pl line 16."

The executable modules for everything suggested by the tutorial.

Can anyone help me on this ??


In reply to Can't locate loadable object for module by ramyaesther84

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and all is calm...

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (7)
    As of 2018-08-14 13:47 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Asked to put a square peg in a round hole, I would:









      Results (150 votes). Check out past polls.

      Notices?