On 12 October 2011 16:00, Torsten Schoenfeld <[email protected]> wrote:
> Looks like Glib's mechanism is not C++-safe: specifically, the "extern XS"
> trick does not work because boot_Foo is already inside an <extern "C">
> section.  Try this:

It didn't help - same error message.

In the end, I took the mechanism used in Win32::GUI, putting in lib/Foo.pm

sub bootstrap_subpackage {
    my($package) = @_;
    $package = 'Foo::' . $package;
    my $symbol = $package;
    $symbol =~ s/\W/_/g;
    no strict 'refs';
    DynaLoader::dl_install_xsub(
        "${package}::bootstrap",
        DynaLoader::dl_find_symbol_anywhere( "boot_$symbol" )
    );
    &{ "${package}::bootstrap" };
}

bootstrap_subpackage 'Bar';

Regards

Jeff

Reply via email to