Hey monks,

As per ur suggestions to my earlier thread 'embed perl in C', I installed free Borland 5.5 C/C++ compiler. I copied 'extern.h' & 'perl.h' header files from 'C:\perl\Lib\Core' to 'C:\borland\BCC5\include' directory. My perl embedded C code is
#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) { my_perl = perl_alloc(); perl_construct(my_perl); perl_parse(my_perl, NULL, argc, argv, (char **)NULL); perl_run(my_perl); perl_destruct(my_perl); perl_free(my_perl); }
When I compiled this program I got the following errors
E:\>bcc32 perl_inc.c Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland perl_inc.c: Error E2209 c:\Borland\Bcc55\include\perl.h 37: Unable to open include + file 'config.h' Error E2209 c:\Borland\Bcc55\include\perl.h 475: Unable to open includ +e file 'embed.h' Error E2209 c:\Borland\Bcc55\include\perl.h 490: Unable to open includ +e file 'strings.h' Error E2257 c:\Borland\Bcc55\include\perl.h 1078: , expected Error E2257 c:\Borland\Bcc55\include\perl.h 1079: , expected Error E2257 c:\Borland\Bcc55\include\perl.h 1271: , expected Error E2257 c:\Borland\Bcc55\include\perl.h 1751: , expected Error E2209 c:\Borland\Bcc55\include\perl.h 1807: Unable to open inclu +de file 'handy.h' Error E2209 c:\Borland\Bcc55\include\perl.h 1971: Unable to open inclu +de file 'unixish.h' Error E2139 c:\Borland\Bcc55\include\perl.h 2287: Declaration missing +; Error E2139 c:\Borland\Bcc55\include\perl.h 2288: Declaration missing +; Error E2139 c:\Borland\Bcc55\include\perl.h 2290: Declaration missing +; Error E2293 c:\Borland\Bcc55\include\perl.h 2302: ) expected Error E2209 c:\Borland\Bcc55\include\perl.h 2325: Unable to open inclu +de file 'iperlsys.h' Fatal F1003 c:\Borland\Bcc55\include\regexp.h 18: Error directive: Mus +t use C++ for REGEXP.H *** 15 errors in Compile ***
Then I just copied all the required header files(only those which are not found in borland include folder) from 'C:\perl\lib\core' directory to 'c:\borland\bcc5\include' directory.

After copying I still am getting errors like
E:\>bcc32 perl_inc.c Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland perl_inc.c: Error E2303 c:\Borland\Bcc55\include\win32.h 314: Type name expected Error E2293 c:\Borland\Bcc55\include\win32.h 413: ) expected Error E2293 c:\Borland\Bcc55\include\perlio.h 105: ) expected Error E2293 c:\Borland\Bcc55\include\perlio.h 106: ) expected Error E2293 c:\Borland\Bcc55\include\perlio.h 108: ) expected Error E2293 c:\Borland\Bcc55\include\perlio.h 110: ) expected Error E2141 c:\Borland\Bcc55\include\perlio.h 111: Declaration syntax +error Error E2293 c:\Borland\Bcc55\include\perlio.h 112: ) expected Error E2293 c:\Borland\Bcc55\include\perlio.h 214: ) expected Error E2293 c:\Borland\Bcc55\include\perlio.h 227: ) expected Error E2303 c:\Borland\Bcc55\include\perlio.h 339: Type name expected Error E2303 c:\Borland\Bcc55\include\perlio.h 342: Type name expected Error E2293 c:\Borland\Bcc55\include\perlio.h 345: ) expected Error E2293 c:\Borland\Bcc55\include\perlio.h 354: ) expected Error E2293 c:\Borland\Bcc55\include\perlio.h 358: ) expected Error E2293 c:\Borland\Bcc55\include\perlio.h 365: ) expected Error E2293 c:\Borland\Bcc55\include\perlio.h 370: ) expected Error E2303 c:\Borland\Bcc55\include\win32iop.h 73: Type name expected Error E2303 c:\Borland\Bcc55\include\win32iop.h 74: Type name expected Error E2303 c:\Borland\Bcc55\include\win32iop.h 77: Type name expected Error E2303 c:\Borland\Bcc55\include\win32iop.h 133: Type name expecte +d Error E2238 c:\Borland\Bcc55\include\perl.h 1775: Multiple declaration + for 'AV' Warning W8017 c:\Borland\Bcc55\include\dosish.h 137: Redefinition of ' +Stat' is not identical Error E2257 c:\Borland\Bcc55\include\perl.h 2075: , expected Error E2257 c:\Borland\Bcc55\include\perl.h 2076: , expected Error E2257 c:\Borland\Bcc55\include\perl.h 2077: , expected Error E2228 c:\Borland\Bcc55\include\perl.h 2077: Too many error or wa +rning messages *** 26 errors in Compile ***
Can I use borland C/C++ compiler for embedding perl in to C? If I can not which compiler(freeware) should I use for this purpose?

Is there any other way I can embed perl script in to C & C in to perl?

Thanks in advance

In reply to Perl & borland 5.5 C/C++ Compiler by Nalina

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.