Unfortunatelly, I have problems with using Inline in PerlTeX.

Here's a little LaTeX code I wrote to test the concept:

\documentclass{article} \usepackage{perltex} \perldo{ `rm -rf ./_Inline && mkdir ./_Inline`; use Inline Config => DIRECTORY => './_Inline/'; } \perlnewcommand{\compilec}[1]{ { my $cc = "void just_compile() { $_[0] };"; Inline->bind(C => $cc); just_compile(); ""; } } \begin{document} \compilec{1 + 1;} \end{document}

It works fine, i.e. the code compiles. However, when I change the expression to something invalid, e.g.:

\compilec{1 + nonexisting;}

TeX spits no errors and just hangs at 100% CPU for both Perl and Tex.

Running the corresponding "clean" Perl code outside PerlTeX and looking I see it dies:

/home/jest/perl/perl-5.10.1/bin/perl /home/jest/perl/perl-5.10.1/lib/s +ite_perl/5.10.1/ExtUtils/xsubpp -typemap /home/jest/perl/perl-5.10.1 +/lib/5.10.1/ExtUtils/typemap perltext1_pl_f7f6.xs > perltext1_pl_f7 +f6.xsc && mv perltext1_pl_f7f6.xsc perltext1_pl_f7f6.c cc -c -I/home/jest/temp/t -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-st +rict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFI +LE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"0.00\" -DXS_VERSIO +N=\"0.00\" -fPIC "-I/home/jest/perl/perl-5.10.1/lib/5.10.1/i486-linux +-gnu-thread-multi/CORE" perltext1_pl_f7f6.c perltext1_pl_f7f6.xs: In function ‘just_compile’: perltext1_pl_f7f6.xs:5: error: ‘bla’ undeclared (first use in this fun +ction) perltext1_pl_f7f6.xs:5: error: (Each undeclared identifier is reported + only once perltext1_pl_f7f6.xs:5: error: for each function it appears in.) make: *** [perltext1_pl_f7f6.o] Error 1 A problem was encountered while attempting to compile and install your + Inline C code. The command that failed was: make > out.make 2>&1 The build directory was: /home/jest/temp/t/_Inline/build/perltext1_pl_f7f6 To debug the problem, cd to the build directory, and inspect the outpu +t files. at perltext1.pl line 8

BTW, PerlTeX handles normal die-s just fine; but in this case it can't handle errors.


In reply to Re^2: C-like structures parsing and validation by przemo
in thread C-like structures parsing and validation by przemo

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.