M
Mr Hyde
Hi guys,
I don't know if you'll be able to help me with this, but I'll give it
a go...
I'm trying to embed some perl in a VC++ program using the following
code:
char *embedding[] = { "", "drawGraph.pl", "0" };
my_perl = perl_alloc();
perl_construct( my_perl );
perl_parse(my_perl, NULL, 3, embedding, NULL);
perl_run(my_perl);
perl_call_argv("drawGraph", G_DISCARD | G_NOARGS, embedding);
Now this calls the subroutine drawGraph in the file drawGraph.pl ok if
there are no modules being included. However as soon as I include the
line
use GD::Graph::bars;
it crashes. I'm assuming it has something to do with what is described
on this page:
http://www.monster-submit.com/resou...erlembed.html#Using_Perl_modules_which_themse
however I have been unable to implement that solution. After adding
the code thus:
#ifdef __cplusplus
# define EXTERN_C extern "C"
#else
# define EXTERN_C extern
#endif
static void xs_init _((void));
EXTERN_C void boot_DynaLoader _((CV* cv));
EXTERN_C void boot_Socket _((CV* cv));
EXTERN_C void
xs_init()
{
char *file = __FILE__;
/* DynaLoader is a special case */
newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
newXS("Socket::bootstrap", boot_Socket, file);
}
When compiling I get the error:
linkage specification contradicts earlier specification for 'xs_init'
D:\......\PerlThing\PerlThingDlg.cpp(187) : see declaration of
'xs_init'
followed by two:
error C2664: 'Perl_newXS' : cannot convert parameter 3 from 'void
(struct cv *)' to 'void (__cdecl *)(struct interpreter *,struct cv *)'
None of the functions with this name in scope match the target
type
I have been unable to find where to go from here. I don't really
understand what's going on, and I haven't been able to find a resource
that explains this. Is there an easier way around this? Is there
something I should have read up on before posting?
Thanks guys,
Hyde
I don't know if you'll be able to help me with this, but I'll give it
a go...
I'm trying to embed some perl in a VC++ program using the following
code:
char *embedding[] = { "", "drawGraph.pl", "0" };
my_perl = perl_alloc();
perl_construct( my_perl );
perl_parse(my_perl, NULL, 3, embedding, NULL);
perl_run(my_perl);
perl_call_argv("drawGraph", G_DISCARD | G_NOARGS, embedding);
Now this calls the subroutine drawGraph in the file drawGraph.pl ok if
there are no modules being included. However as soon as I include the
line
use GD::Graph::bars;
it crashes. I'm assuming it has something to do with what is described
on this page:
http://www.monster-submit.com/resou...erlembed.html#Using_Perl_modules_which_themse
however I have been unable to implement that solution. After adding
the code thus:
#ifdef __cplusplus
# define EXTERN_C extern "C"
#else
# define EXTERN_C extern
#endif
static void xs_init _((void));
EXTERN_C void boot_DynaLoader _((CV* cv));
EXTERN_C void boot_Socket _((CV* cv));
EXTERN_C void
xs_init()
{
char *file = __FILE__;
/* DynaLoader is a special case */
newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
newXS("Socket::bootstrap", boot_Socket, file);
}
When compiling I get the error:
linkage specification contradicts earlier specification for 'xs_init'
D:\......\PerlThing\PerlThingDlg.cpp(187) : see declaration of
'xs_init'
followed by two:
error C2664: 'Perl_newXS' : cannot convert parameter 3 from 'void
(struct cv *)' to 'void (__cdecl *)(struct interpreter *,struct cv *)'
None of the functions with this name in scope match the target
type
I have been unable to find where to go from here. I don't really
understand what's going on, and I haven't been able to find a resource
that explains this. Is there an easier way around this? Is there
something I should have read up on before posting?
Thanks guys,
Hyde