in reply to Re: Can't locate loadable object for module X in @INC (@INC contains: ... )
in thread Can't locate loadable object for module X in @INC (@INC contains: ... )

Thanks, chromatic, that's helpful.

I still believe that a comprehensive repository of Perl core error messages would be great.

This particular case provides 3 reasons:

1. the error "Can't locate loadable object for module X in @INC" is not fully explanatory. I.e., it doesn't say which object it cannot locate.

2. perldiag doesn't mention this error.

3. splain is misleading at best, and arguably wrong:

(F) You said to do (or require, or use) a file that couldn't be found. Perl looks for the file in all the locations mentioned in @INC, unless the file name included the full path to the file. Perhaps you need to set the PERL5LIB or PERL5OPT environment variable to say where the extra library is, or maybe the script needs to add the library name to @INC. Or maybe you just misspelled the name of the file. See perlfunc/require and lib.

  • Comment on Re^2: Can't locate loadable object for module X in @INC (@INC contains: ... )
  • Download Code

Replies are listed 'Best First'.
Re^3: Can't locate loadable object for module X in @INC (@INC contains: ... )
by Anonymous Monk on Nov 17, 2009 at 17:05 UTC
    I still believe that a comprehensive repository of Perl core error messages would be great.

    Its called perldiag.

    it doesn't say which object it cannot locate.

    Um, the one for module X :D

    C:\> perl -e"package Foo; use base qw! DynaLoader !; bootstrap Foo;" Can't locate loadable object for module Foo in @INC (@INC contains: C: +/perl/5.10.1/lib/MSWin32-x86-multi-thread C:/perl/5.10.1/lib C:/perl/ +site/5.10.1/lib/MSWin32-x86-multi-thread C:/perl/site/5.10.1/lib .) a +t C:/perl/5.10.1/lib/MSWin32-x86-multi-thread/DynaLoader.pm line 103 DynaLoader::croak('Can\'t locate loadable object for module Fo +o in @INC (@INC co...') called at C:/perl/5.10.1/lib/MSWin32-x86-mult +i-thread/DynaLoader.pm line 170 DynaLoader::bootstrap('Foo') called at -e line 1
    Technically its looking for "Foo$Config{dlext}", so maybe the error message should actually spell that out?

    2. perldiag doesn't mention this error.

    Yes it does

    C:\>perldoc perldiag |grep -C2 "loadable object" the file, say, by doing "make install". Can't locate loadable object for module %s in @INC (F) The module you loaded is trying to load an external librar +y, like for example, "foo.so" or "bar.dll", but the DynaLoader mo +dule

    3. splain is misleading at best, and arguably wrong:

    Hmm, looks incomplete, I think you found a bug, you should report it

      If you're on a typical UNIX/Linux box, the loaction of these lib modules is controlled by LD_LIBRARY_PATH. Search your relavant perl dirs for .so file Unix or .dll Windows, and make sure these dirs are included. Typically it's export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:...FULL PATHS. ESPCIALLY NOTE, that these are probably not in INC, just the executables will be there.