Hi,
I'm trying to use PERL inside C code.
I got to the point where I can run a simple perl program in C code.
Now I want to use some existing code that uses dynamic loading such as
use Data::Dumper;
I read in many places that you have to add some "glue" code for it to work:
EXTERN_C void boot_DynaLoader (pTHX_ CV* cv);
EXTERN_C void boot_Socket (pTHX_ CV* cv);
EXTERN_C void
xs_init(pTHX)
{
char *file = __FILE__;
dXSUB_SYS;
/* DynaLoader is a special case */
newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
newXS("Socket::bootstrap", boot_Socket, file);
}
but when I try compiling I get an error:
Building target: testC
i686-pc-linux-gnu-gcc -L/usr/lib/ -rdynamic -L/usr/local/lib /usr/lib/perl5/5.8.6/i686-linux/auto/DynaLoader/DynaLoader.a -L/usr/lib/perl5/5.8.6/i686-linux/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc -o testC seqTest.o test.o -lperl -lJudy
seqTest.o: In function xs_init':
../seqTest.c:26: undefined reference to boot_DynaLoader'
../seqTest.c:27: undefined reference to boot_Socket'
I use all the flags and libraries that were used to build my perl.
I run on Linux with GenToo.
I've been struggling with this one for half a day and running out of ideas...
Anybody have a clue what could be wrong?
Thanks
Mark
(0)
]
