Dear all monks:

I try to use threads in my project, and I have installed threads to my own local lib directory in my project directory, when I try to run the script in 64bit box, It throws error msg like these:

Can't load '/home/larry/project/sysmonitor/lib/perl5/5.8.5/i386-linux- +thread-multi/auto/threads/threads.so' for module threads: /home/larry +/project/sysmonitor/lib/perl5/5.8.5/i386-linux-thread-multi/auto/thre +ads/threads.so: cannot open shared object file: No such file or direc +tory at /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/XSLoader.pm +line 68. at /home/larry/project/sysmonitor/lib/perl5/5.8.5/i386-linux-thread-m +ulti/threads.pm line 32 Compilation failed in require at ./monitorSrv.pl line 47. BEGIN failed--compilation aborted at ./monitorSrv.pl line 47.
and I have add the lib directory by "use lib"like this:
use strict; use warnings; #use diagnostics; use FindBin; use lib "$FindBin::Bin/lib64/perl5/5.8.5/x86_64-linux-thread-multi"; use lib "$FindBin::Bin/lib64/perl5/5.8.5/x86_64-linux-thread-multi/au +to"; use lib "$FindBin::Bin/lib64/perl5/site_perl/5.8.5"; use lib "$FindBin::Bin/lib64/perl5/site_perl/5.8.5/auto"; use lib "$FindBin::Bin/lib64/perl5/site_perl/5.8.5/x86_64-linux-threa +d-multi"; use lib "$FindBin::Bin/lib64/perl5/site_perl/5.8.5/x86_64-linux-threa +d-multi/auto"; use lib "$FindBin::Bin/lib/perl5/5.8.5/i386-linux-thread-multi"; use lib "$FindBin::Bin/lib/perl5/5.8.5/i386-linux-thread-multi/auto"; use lib "$FindBin::Bin/lib/perl5/site_perl/5.8.5"; use lib "$FindBin::Bin/lib/perl5/site_perl/5.8.5/auto"; use lib "$FindBin::Bin/lib/perl5/site_perl/5.8.5/i386-linux-thread-mu +lti"; use lib "$FindBin::Bin/lib/perl5/site_perl/5.8.5/i386-linux-thread-mu +lti/auto";
And I check the threads.so, It is laid on where it should be:
[larry@localhost sysmonitor]$ ll /home/larry/project/sysmonitor/lib/pe +rl5/5.8.5/i386-linux-thread-multi/auto/threads/threads.so -rwxrwxr-x 1 larry larry 110977 Sep 27 16:46 /home/larry/project/sysm +onitor/lib/perl5/5.8.5/i386-linux-thread-multi/auto/threads/threads.s +o
Because, I sometimes test my script at 32 bit box, sometimes 64bit, so I install both arch threads, and I check their location:
/home/larry/project/sysmonitor/lib64/perl5/5.8.5/x86_64-linux-thread-m +ulti/threads.pm /home/larry/project/sysmonitor/lib/perl5/5.8.5/i386-linux-thread-multi +/threads.pm
I guess may be this is the evil that cause the problem.
but, Can't the perl find the right arch threads.pm by itself? Or, there is some way to instrust the perl to find the right threads.pm.
Can any one give some tips. I am very confused about this problem.

In reply to Can't load threads.so error by sunshine_august

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.