in reply to Re^2: 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: ... )

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

C:\>cat 2 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 -e line 1 C:\>splain 2 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 .) at -e line 1 (#1) 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 -e line 1 C:\>cat 2 Can't locate loadable object for module Foo in @INC C:\>splain 2 Can't locate loadable object for module Foo in @INC (#1) (F) The module you loaded is trying to load an external library, l +ike for example, foo.so or bar.dll, but the DynaLoader module was unable to locate this library. See DynaLoader.

Replies are listed 'Best First'.
Re^4: Can't locate loadable object for module X in @INC (@INC contains: ... )
by Anonymous Monk on Sep 08, 2011 at 16:25 UTC
    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.