Hi All,
I'm getting the following error when running some perl
code (that calls functions in my XS module) after
compiling and installing my perl-xs module:
perl: relocation error:
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/My_XS_Module/My_XS_Module.so:
undefined symbol: FunctionName
I can compile and run C++ programs that use the C++
library (that I'm wrapping) and the FunctionName
function OK.
I have LIBS in Makefile.PL set as:
'LIBS' => ['-lMyStaticCLib -lm -lz -ljpeg -lpng
-ltiff'],
I also have CC set to point to g++ in Makefile.PL:
$CC = 'g++';
If I do a ldd of My_XS_Module.so:
ldd
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/My_XS_Module/My_XS_Module.so
libz.so.1 => /usr/lib/libz.so.1 (0x40056000)
libjpeg.so.62 => /usr/lib/libjpeg.so.62
(0x40064000)
libpng12.so.0 => /usr/lib/libpng12.so.0
(0x40082000)
libtiff.so.3 => /usr/lib/libtiff.so.3
(0x400a5000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5
(0x400e7000)
libm.so.6 => /lib/i686/libm.so.6 (0x4019a000)
libgcc_s.so.1 => /lib/libgcc_s.so.1
(0x401bc000)
libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
libnsl.so.1 => /lib/libnsl.so.1 (0x401c4000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2
(0x80000000)
All shared libraies are OK, it just the static C
library doesn't seem to be linked properly with my xs
module.
I have another XS module that works in the same way,
and it works fine on the same machine. So:
1 - I know the static (.a) C++ library works because I
can compile and run programs that use it.
2 - The problem XS module compiles/links without
errors.
3 - Another XS module on the same box that use a
static C++ library works OK.
Any ideas where I'm going wrong?
Thanks for any help on this,
Chris
perl -v
This is perl, v5.8.0 built for i386-linux-thread-multi
(with 1 registered patch, see perl -V for more detail)
gcc -v
Reading specs from
/usr/lib/gcc-lib/i386-redhat-linux/3.2/specs
Configured with: ../configure --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix
--disable-checking --host=i386-redhat-linux
--with-system-zlib --enable-__cxa_atexit
Thread model: posix
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus