Re: Multiple packages in a single .so

Wouter Verhelst wrote:
I'm writing perl bindings for a Glib-using library, by following the
tutorial that I was pointed to on this list a while back.

It works, mostly; I have .xs files for each of my GObject definitions,
and they get compiled and linked into a single .so file that perl
happily loads if I say "use MyModule;".

However, what I don't seem to be able to do is to tell perl about all
the different GObjects, similar to what happens with Gtk2::Window when
you say "use Gtk2 -init;" (and only that).

Any hints what I should be looking at to make "MyModule::foo::bar()"
work when I did just "use MyModule"?

The actual mechanism for telling the perl interpreter that your xsubs (and
indeed your Glib::Objects) exist is in your module's BOOT code.  If you have
more than one XS file in your extension, you need all of those bits of BOOT
code to be called; Gtk2-Perl uses Glib::CodeGen's write_boot() method to
handle this stuff, and the documentation attempts to explain in more detail.

I believe that all of this stuff implicitly assumes that you're following the
Gtk2-Perl naming conventions in your extension.

muppet <scott at asofyet dot org>

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