0

i am all new to perl but i have a perl script that require alot of modules to work which all are found in folder lib/ , when i try to run the script and it start loading the modules (use x;) the script fails when calling dynaloader x; saying cant find loadable objects for modules x @INC then i figured out that these modules have shared objects (.so) files that dynaloader fails to find and its names are all in form libx.so and they are in the same folder of the .pm files .. so the question is how could i make dynaloader load the modules and there shared libraries .

Any help would be appreciated.. p.s: -i am running the script through cygwin. -these modules are locale modules , i dont have the makefile.pl for them and i cant get it either.

Helmy
  • 115
  • 1
  • 3
  • 10
  • Are you sure the shared objects (.so) are cygwin ones ? What is the output of `file your_shared_object.so` ? – matzeri Jul 23 '16 at 20:34
  • Maybe you need to set `LD_LIBRARY_PATH` to include correct path? See [%ENV doesn't work and I cannot use shared library](http://stackoverflow.com/questions/8657005/env-doesnt-work-and-i-cannot-use-shared-library) – Håkon Hægland Jul 23 '16 at 20:38
  • +Håkon Hægland the LD_LIBRARY_is set to the /lib folder – Helmy Jul 24 '16 at 05:42
  • +matzer, how can i make sure that these files are cygwin ones ? the out of file is "ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped" – Helmy Jul 24 '16 at 05:48
  • @matzeri (@AhmedHelmy please do not use `+` to address commenters, see [How do comment @replies work?](http://meta.stackexchange.com/questions/43019/how-do-comment-replies-work) for more information ) – Håkon Hægland Jul 24 '16 at 07:11
  • ELF 32-bit LSB are linux one, you can not run it on windows/cygwin – matzeri Jul 24 '16 at 09:17

2 Answers2

0

From 1st page of cygwin website

Cygwin is not:

a way to run native Linux apps on Windows. You must rebuild your application from source if you want it to run on Windows.

a way to magically make native Windows apps aware of UNIX® functionality like signals, ptys, etc. Again, you need to build your apps from source if you want to take advantage of Cygwin functionality.

As your shared libs are ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped you have a package built for a Unix/Linux 32 bit. It can not run on Cygwin/Windows.

On windows the format is PE32

$ file /usr/bin/cygreadline7.dll
/usr/bin/cygreadline7.dll: PE32+ executable (DLL) (console) x86-64, for MS Windows
$ file /cygdrive/c/windows/system32/kernel32.dll
/cygdrive/c/windows/system32/kernel32.dll: PE32+ executable (DLL) (console) x86-64, for MS Windows
Community
  • 1
  • 1
matzeri
  • 8,062
  • 2
  • 15
  • 16
0

You just need to export all perl path from your server to server in config file

export PERLLIB=/sbcimp/run/pd/…/cpan pat export PERLLIB=$PERLLIB:/app/localstorage/path to your perl lib cpan lib and oracle lib include all path

faizan9689
  • 21
  • 1