Before folks start jumping to conclusions please read carfully:
I really don't think its a binary issue since I'm not even using the binary. I'm linking with the -lperl -lcrypt libs, with includes files loocated typically in /usr/lib/perl5/5.8.X/i586-linux-thread-multi/CORE
I'm running an embedded perl script in some C++ code, using one of the commonly available example perl stack routines.
int psCheck( const char* prog_name )
{
dSP;
int ret;
int count = 0;
ENTER;
SAVETMPS;
PUSHMARK( SP );
XPUSHs( sv_2mortal( newSVpv( prog_name, 0 ) ) );
PUTBACK;
ret = call_pv("psCheck", G_SCALAR);
SPAGAIN;
if (ret != 1)
croak("Big trouble\n" ;
count = POPi;
PUTBACK;
FREETMPS;
LEAVE;
return count;
}
The errors:
adaptermain.cpp: In function `int psCheck(const char*)':
*adaptermain.cpp:365: error: `push_scope' undeclared (first use this f
+unction)
*adaptermain.cpp:365: error: (Each undeclared identifier is reported o
+nly once
*for each function it appears in.)
*adaptermain.cpp:366: error: `save_int' undeclared (first use this fun
+ction)
*adaptermain.cpp:368: error: `markstack_grow' undeclared (first use th
+is function)
*adaptermain.cpp:369: error: `stack_grow' undeclared (first use this f
+unction)
*adaptermain.cpp:369: error: `newSVpv' undeclared (first use this func
+tion)
*adaptermain.cpp:369: error: `sv_2mortal' undeclared (first use this f
+unction)
*adaptermain.cpp:372: error: `call_pv' undeclared (first use this func
+tion)
*adaptermain.cpp:377: error: `croak' undeclared (first use this functi
+on)
*adaptermain.cpp:379: error: `sv_2iv' undeclared (first use this funct
+ion)
*adaptermain.cpp:381: error: `free_tmps' undeclared (first use this fu
+nction)
*adaptermain.cpp:382: error: `pop_scope' undeclared (first use this fu
+nction)
All the routines defined within the MACRO definitions come back as undefined. For example ENTER, which uses push_scope, my compiler (3.3.3) says is undefined. I recall this issue way back when I wrote this code and for the life of me I can't figure out what I did to fix it then.
I have included the needed <EXTERN.h> and <perl.h> files.
Whatever is needed to be done, I'm sure it has nothing to do with compilation options, makefiles or code since this was all fine before and I have handled then in my makefiles. It must be an environment issue which I might have been left out (LD_LIBRARY_PATH, or PATH for example).
This does not seem to be a very generic issue, since google turns up little, that is applicable.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.