perlmonk1729 has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I've created my first module using SWIG to access a set of C functions. When I run my simple test perl script to access a C function, I get an error that perl is unable to find an ".al" file with the name of the function I'm trying to invoke. What are these files?

I have named the module, .pm file and .so file the same, so no name mismatch issue.

Thx

Replies are listed 'Best First'.
Re: Unable to find ".al" file error
by almut (Canon) on Oct 10, 2009 at 20:33 UTC
      Thanks for the link almut. I think I got some understanding of the .al files. I'm not sure how/why my perl script is looking for it though. I didnt see any reference to using AutoLoader in the SWIG instructions. I'm not sure the easiest way forward. For now, my goal is to get my C APIs running from Perl. I can live with slower performance if necessary in short term.

      Steps till I ran into this problem

      - I ran swig and generated a .pm file

      - Modified my existing C API's build (Makefile) to compile the sources + the _wrap.c file generated by swig into a shared lib.

      - Created a simple perl script with "use <mymodule>" and then invoked one API.

      I did not use MakeMaker or ModuleMaker etc.

      After I read about AutoLoader, AutoSplit, I wentahead and ran autosplit_list_modules on my module's .pm file. I see the lib/auto directories created, but no .al files are until the auto/ directory. Still debugging..any pointers will be helpful.

        I'm not sure how/why my perl script is looking for it though.

        Because its using AutoLoader

Re: Unable to find ".al" file error
by ikegami (Patriarch) on Oct 11, 2009 at 20:39 UTC

    Either your module isn't properly installed, or you're calling a function that doesn't exist.

    I did not use MakeMaker or ModuleMaker etc.

    Therein lies the problem, I think.