\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}
####
\compilec{1 + nonexisting;}
####
/home/jest/perl/perl-5.10.1/bin/perl /home/jest/perl/perl-5.10.1/lib/site_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_f7f6.xsc && mv perltext1_pl_f7f6.xsc perltext1_pl_f7f6.c
cc -c -I/home/jest/temp/t -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"0.00\" -DXS_VERSION=\"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 function)
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 output files.
at perltext1.pl line 8