failing because it didn't quote one of the Win32 directories with embedded spaces for gcc

Yes, there are problems with Inline::C and directory names that contain spaces. The problems are not insurmountable, but the best fix is to not install anything into a directory whose name contains any spaces.

For the generation of the XS file and the Makefile.PL I just used InlineX::C2XS - ie, I placed a file named GetCommandLine.c (which contained just the solitary Inline::C function) in the ./src folder and ran
perl -MInlineX::C2XS -e "InlineX::C2XS::c2xs('Win32::GetCommandLine',' +Win32::GetCommandline',{'WRITE_MAKEFILE_PL'=>1,'VERSION'=>0.01})"
That creates the Makefile.PL and GetCommandLine.xs in the cwd. I then spent the next 15 minutes writing by hand GetCommandLine.pm (which I kept stuffing up) ... so I've now modified InlineX::C2XS::c2xs() to accept a 'WRITE_PM'=>1 argument that writes that .pm stub file as well. (This will be in the next CPAN release.)

Note that there's more than one way to write an XS file (oO ... deja vu :-). The rendition that I posted is the way that Inline::C (which is used by InlineX::C2XS) autogenerated it.

Cheers,
Rob

In reply to Re^3: Win32::API Memory Exception with GetCommandLine() (which returns a static string) by syphilis
in thread Win32::API Memory Exception with GetCommandLine() (which returns a static string) by Wyrdweaver

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.