I haven't tried this, but I did look at the code in C::Scan.pm, in the C::Preprocess section, the new sub contains the following:
my $cmd = "echo '\#include \"$filename\"' | $Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags} $Cpp->{cppminus} |"; #my $cmd = "$Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags} $Cpp->{cppminus} < $filename |"; #my $cmd = "echo '\#include <$filename>' | $Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags} $Cpp->{cppminus} |";
So I'm wondering you could try this:
#my $cmd = "echo '\#include \"$filename\"' | $Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags} $Cpp->{cppminus} |"; my $cmd = "$Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags} $filename |"; #my $cmd = "echo '\#include <$filename>' | $Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags} $Cpp->{cppminus} |";
I ended up putting a .bat file in the same dir with h2xs.bat called cppstdin.bat, it's contents:
@echo off cl /E %*
Thompson, Lloyd D. (NSSD) wrote:
Hello,
I'm trying to use h2xs to create a perl interface to an existing c++ api library. The first problem I had was C::Scan wasn't installed so I installed it through ppm.
Then C::Scan initially failed because cppstdin wasn't defined, so in lib\Config.pm I changed cppstdin='' to cppstdin='cl -nologo -E'.
Now my current problem is when I call h2xs with header file arguments C::Scan executes my cppstdin statement but without a file argument. The error I receive is 'cl : Command line error D2003 : missing source filename'.
So my thought is I missed something when I changed the cppstdin line in Config.pm. I have tried this h2xs process under cygwin and C::Scan was able to successfully parse the header file and h2xs generated a filled out .xs file (I had other issues with this I won't discuss here, which is why I'm trying to get the activestate version working). Any ideas are very appreciated.
Thanks
Lloyd
------------------------------------------------------------------------
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs