Hello Monks, I'm seeking to be at peace with Inline::CPP. This is my test code:

#!/usr/bin/perl use strict; use warnings; use Inline 'info', 'force', 'clean'; use Inline 'CPP'; print "9 + 16 = ", add(9, 16), "\n"; print "9 - 16 = ", subtract(9, 16), "\n"; __END__ __CPP__ random junk; int add(int x, int y) { return x + y; } int subtract(int x, int y) { return x - y; }

You'll note the glaring random junk that should cause gcc to error, but it doesnt, it compiles fine, and then perl complains that &main::add is undefined. Here is the output:

$ ./testInline.pl <-----------------------Information Section--------------------------- +--------> Information about the processing of your Inline CPP code: Your source code needs to be compiled. I'll use this build directory: /home/andy/projects/rigel/libs/_Inline/build/testInline_pl_6b67 and I'll install the executable as: /home/andy/projects/rigel/libs/_Inline/lib/auto/testInline_pl_6b67/tes +tInline_pl_6b67.so <-----------------------End of Information Section-------------------- +--------> Use of uninitialized value in join or string at /usr/local/share/perl5 +/Inline/C.pm line 603. Undefined subroutine &main::add called at ./testInline.pl line 7.

I'm using Slackware64 14.2+current, perl 5.28, packages installed via cpanm. If I test with Inline::C is works fine, but CPP doesn't. I'm lost, and cannot seem to find my way.

Thanks for your time.


In reply to Inline::CPP code ignored by jaandy

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.