in reply to Perl embedding woes: undefined symbols

You'd need this:
EXTERN_C void boot_DynaLoader(pTHX_ CV* cv); EXTERN_C void boot_List__Util(pTHX_ CV* cv); static void xs_init(pTHX) { char *file = __FILE__; newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); newXS("List::Util::bootstrap", boot_List__Util, file); }

(Scalar::Util's C guts are actually loaded by List::Util.)

Now, there's still the matter of linking in ListUtil.o. I don't know how to do that (other than statically linking it into Perl).

Replies are listed 'Best First'.
Re^2: Perl embedding woes: undefined symbols
by robhoelz (Acolyte) on Apr 29, 2010 at 20:53 UTC
    I figured I could do that, but I'd rather the users of the Lua-Perl bridge not have to recompile the module every time they want to use an XS module.
      So they have to have Perl installed locally, then. If so, why not just run Perl as a child?
        Eventually, I'd like for the two environments to be able to exchange data easily. For example, from Lua:
        require 'perl'
        local inc = perl['@INC']
        for _, v in ipairs(inc) do
          print(v)
        end