tony_cusano
asked on
Can't locate object method "new" via package "Crypt::CBC"
I have a perl script which works with no problems, but when I use perlcc to compile the perl script I receive the following error: Can't locate object method "new" via package "Crypt::CBC"
Have anyone any idea why this happens once compiled?
Have anyone any idea why this happens once compiled?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
are you using compiled executable on the same machine and got the complaint? If it's a different machine it's easier to understand.
I can't see any reason why compiled as above with the so files ready would cause problem like that. Can you try perlcc with -gen or -sav enabled to see if anything looks unusual in C code?
I can't see any reason why compiled as above with the so files ready would cause problem like that. Can you try perlcc with -gen or -sav enabled to see if anything looks unusual in C code?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I found out that the Crypt::CBC is an Perl-only implementation and does not produce the .so could this be a problem?
yelp, I think so. It's perlcc's convention to compile pm to so files, if it can't, then I guess your program has problem at run time finding the implementation of Crypt::CBC. Basically Crypt::CBC is compiled as a shared library, but if it fails to produce that library, then the executable can't use it. But I wonder if any other expert would have some work-around suggestion?
I have not used PerlCC that much, I used Perl2Exe whith Crypt::CBC for Net::SSH::Perl.
Like I said I just had to include all the modules specifically.
I kinda agree with acameron (and his suggestion slight differs from mine but follows the same principle), I also had experience with perl2exe and also met with the same problem, and all I had to do is to add command line to include the module specifically (I think) or maybe I used "use lib". I think I probably added "use lib" at the start of the script or something. Anyway it worked for me.
Nothing has happened on this question in more than 8 weeks. It's time for cleanup!
My recommendation, which I will post in the Cleanup topic area, is to
split points [grade B] between inq123 and acameron (only partial resolution).
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
jmcg
EE Cleanup Volunteer
My recommendation, which I will post in the Cleanup topic area, is to
split points [grade B] between inq123 and acameron (only partial resolution).
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
jmcg
EE Cleanup Volunteer
ASKER
Here's the syntax
cc -xO3 -xdepend -I/usr/perl5/5.00503/sun4-
that gives me the problem.