Hi,
I am try to embed perl in my c++ code,I wrote following sample code
----------------------------------------------------------------------------------------------
#include <EXTERN.h> /* from the Perl distribution */
#include <perl.h> /* from the Perl distribution */
static PerlInterpreter *my_perl; /*** The Perl interpreter ***/
int main(int argc, char **argv, char **env)
{
PERL_SYS_INIT3(&argc,&argv,&env);
my_perl = perl_alloc();
perl_construct(my_perl);
//PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
perl_parse(my_perl, NULL, argc, argv, (char **)NULL);
perl_run(my_perl);
perl_destruct(my_perl);
perl_free(my_perl);
PERL_SYS_TERM();
}
-------------------------------------------------------------------------------------------------
compilation went fine,when I try to link this with libperl.so I get following error
perlint.o: In function `main':
perlint.c:(.text+0x42): undefined reference to `PL_exit_flags'
perlint.c:(.text+0x49): undefined reference to `PL_exit_flags'
collect2: ld returned 1 exit status
----------------------------------------------------------------------------------------------------
Note: I am compiling this code using cross-compiler my host is solaris 2.10 and
target is fedora 6( i686-linux).
Also I copied libperl.so from fedora machine to solaris and trying to link with same library.
Could anyone please provide me some input.
Thanks In Advance
jmishra