in reply to Re^2: Win32::API Memory Exception with GetCommandLine() (which returns a static string)
in thread Win32::API Memory Exception with GetCommandLine() (which returns a static string)

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
  • Comment on Re^3: Win32::API Memory Exception with GetCommandLine() (which returns a static string)
  • Select or Download Code