But that doesn't work with the AUTOWRAP script that I have ... and I'm not able to come to an understanding of why that is so ... given my (now) current state of insobriety. Perhaps all will become clear to me tomorrow. In the meantime, here's 'autowrap.pl':
use warnings; use Inline C => Config => BUILD_NOISY => 1, TYPEMAPS => 'simple_typemap.txt', AUTO_INCLUDE => '#include "D:/C/simple.h"', CLEAN_AFTER_BUILD => 0, ENABLE => AUTOWRAP, LIBS => '-LD:/C -lsimple'; use Inline C => q{simple_double simple(simple_double); }; print simple(1.032);
and here's what happens when I run 'perl autowrap.pl' (using your amendments to C.pm):
. . Starting Build Compile Stage Starting "perl Makefile.PL" Stage String found where operator expected at Makefile.PL line 8, near "'NAM +E'" (Missing semicolon on previous line?) String found where operator expected at Makefile.PL line 9, near "'aut +owrap_pl_e 826'" (Missing semicolon on previous line?) String found where operator expected at Makefile.PL line 10, near "'IN +C'" (Missing semicolon on previous line?) String found where operator expected at Makefile.PL line 11, near "'-I +D:/pscrpt/ inline/special'" (Missing semicolon on previous line?) String found where operator expected at Makefile.PL line 12, near "'LI +BS'" (Missing semicolon on previous line?) String found where operator expected at Makefile.PL line 16, near "'VE +RSION'" (Missing semicolon on previous line?) String found where operator expected at Makefile.PL line 17, near "'0. +00'" (Missing semicolon on previous line?) syntax error at Makefile.PL line 4, near "[" Execution of Makefile.PL aborted due to compilation errors. A problem was encountered while attempting to compile and install your + Inline C code. The command that failed was: D:\perl58_M\5.8.8\bin\perl.exe Makefile.PL The build directory was: D:\pscrpt\inline\special\_Inline\build\autowrap_pl_e826 To debug the problem, cd to the build directory, and inspect the outpu +t files. at autowrap.pl line 11 BEGIN failed--compilation aborted at autowrap.pl line 11.
'simple.h' looks like:
#define simple_double double simple_double simple(simple_double d);
and 'simple_typemap.txt' looks like:
simple_double T_S_DOUBLE INPUT T_S_DOUBLE $var = (simple_double)SvNV($arg) OUTPUT T_S_DOUBLE sv_setnv($arg, (simple_double)$var);
Perhaps it's just a simple syntax error in the code you posted ... but I couldn't spot it. It's creating a Makefile.PL that looks like this:
use ExtUtils::MakeMaker; my %options = ( 'TYPEMAPS' [ 'D:\\perl58_M\\5.8.8\\lib\\ExtUtils\\typemap', 'D:\\pscrpt\\inline\\special\\simple_typemap.txt' ] 'NAME' 'autowrap_pl_e826' 'INC' '-ID:/pscrpt/inline/special' 'LIBS' [ '-LD:/C -lsimple' ] 'VERSION' '0.00' ); WriteMakefile(%options); # Remove the Makefile dependency. Causes problems on a few systems. sub MY::makefile { '' }
Gotta go to bed :-)

Cheers,
Rob

In reply to Re^6: What's the difference between a hash ? by syphilis
in thread What's the difference between a hash ? by syphilis

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.