prabakar.bhatt has asked for the wisdom of the Perl Monks concerning the following question:

Dear,

We are trying to use the MD5 feature of perl5.24.3 and facing the following issue.

In our case, we have downloaded the 5.24.3 version and compiled locally on RHEL 7.x machine.

Error is :

symbol lookup error: /usr/local/bin/perl/lib/5.24.3/x86_64-linux-thread-multi/auto/Digest/MD5/MD5.so: undefined symbol: Perl_xs_handshake

Our application is a C application and we call perl_parse function to execute the perl script

Thanks in Advace

compile log:

"../../miniperl" "-I../../lib" "-I../../lib" "../../lib/ExtUtils/xsubpp" -typemap "../../lib/ExtUtils/typemap" -typemap "typemap" MD5.xs > MD5.xsc && mv MD5.xsc MD5.c

cc -c -D_REENTRANT -D_GNU_SOURCE -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -Wall -Werror=declaration-after-statement -Wextra -Wc++-compat -Wwrite-strings -O2 -DVERSION=\"2.54\" -DXS_VERSION=\"2.54\" -fPIC "-I../.." -DU32_ALIGNMENT_REQUIRED MD5.c

cc -shared -O2 -fstack-protector /home/tester/TeMIP-ALB/perl/perl/perl-5.24.3/perlapi.o -L/usr/local/lib -fstack-protector-strong MD5.o -o ../../lib/auto/Digest/MD5/MD5.so

Replies are listed 'Best First'.
Re: undefined symbol: Perl_xs_handshake
by Corion (Patriarch) on Jan 03, 2022 at 10:55 UTC

    Most likely you are mixing Perl versions and your local Perl and the system Perl have different versions.

    This could be caused by having the PERL5LIB environment variable set for example.

    Compare the compiler message:

    /home/tester/TeMIP-ALB/perl/perl/perl-5.24.3/

    vs. the location of the problematic .so:

    /usr/local/bin/perl/lib/5.24.3/

    I would run your C program with a clean environment, and especially empty PERL5LIB (or only the "good" Perl path in it) to make sure that the C program can only find the Perl libraries compiled for it.