http://www.manning.com/jenness/ExtEmbPerlSrc_v0_90.tar.gz
I'm trying to compile chap6\6.8.1 on win32 ActivePerl 5.6.1.
I modify Makefile.PL to have CCFLAGS => '-TP', and I remove the LD/CC options.
Here's how it goes
E:\dev\XS\ExtEmbPerlSrc_v0_90\chap6\6.8.1>perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Coordinate E:\dev\XS\ExtEmbPerlSrc_v0_90\chap6\6.8.1>nmake Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. cp PerlCoordinate.pm blib\lib\PerlCoordinate.pm cp Coordinate.pm blib\lib\Coordinate.pm C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils/xsubpp -typemap C:\ +Perl\lib\ExtUtils\typemap -typemap typemap Coordinate.xs > Coordinat +e .xsc && C:\Perl\bin\perl.exe -MExtUtils::Command -e mv Coordinate.xsc +Coordinate.c Please specify prototyping behavior for Coordinate.xs (see perlxs manu +al) cl -c -TP -O1 -MD -DNDEBUG -DVERSION=\"0.01\" -DXS_VERS +ION=\"0.01\" "-IC:\Perl\lib\CORE" Coordinate.c Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for +80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. Coordinate.c C:\Perl\lib\CORE\dosish.h(111) : warning C4005: 'Stat' : macro redefin +ition C:\Perl\lib\CORE\win32.h(306) : see previous definition of 'St +at' C:\Perl\lib\CORE\perl.h(1748) : error C2146: syntax error : missing '; +' before identifier 'perl_os_thread' C:\Perl\lib\CORE\perl.h(1748) : fatal error C1004: unexpected end of f +ile found NMAKE : fatal error U1077: 'cl' : return code '0x2' Stop.
-TP means treat all files as c++ files. If I try -Tp Coordinate.c it will treat Coordinate.c as a c++ file. So I try the following manually
cl -c -nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_D +ES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_MSVCRT_R +EADFIX -O1 -MD -DNDEBUG -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" + "-IC:\Perl\lib\CORE" -Tp Coordinate.c
and am faced with
C:\PROGRA~1\MICROS~3\VC98\INCLUDE\math.h(514) : error C2894: templates + cannot be declared to have 'C' linkage C:\PROGRA~1\MICROS~3\VC98\INCLUDE\streamb.h(89) : error C2059: syntax +error : '(' C:\PROGRA~1\MICROS~3\VC98\INCLUDE\streamb.h(89) : error C2143: syntax +error : missing ',' before '->' C:\PROGRA~1\MICROS~3\VC98\INCLUDE\streamb.h(89) : error C2501: 'Perl_I +StdIO_ptr' : missing storage-class or type specifiers C:\PROGRA~1\MICROS~3\VC98\INCLUDE\streamb.h(89) : error C2059: syntax +error : '->' C:\PROGRA~1\MICROS~3\VC98\INCLUDE\istream.h(108) : warning C4003: not +enough actual parameters for macro 'PerlLIO_read' C:\PROGRA~1\MICROS~3\VC98\INCLUDE\istream.h(109) : warning C4003: not +enough actual parameters for macro 'PerlLIO_read' C:\PROGRA~1\MICROS~3\VC98\INCLUDE\istream.h(110) : warning C4003: not +enough actual parameters for macro 'PerlLIO_read' C:\PROGRA~1\MICROS~3\VC98\INCLUDE\istream.h(161) : warning C4003: not +enough actual parameters for macro 'PerlLIO_read' C:\PROGRA~1\MICROS~3\VC98\INCLUDE\istream.h(161) : warning C4003: not +enough actual parameters for macro 'PerlLIO_read' C:\PROGRA~1\MICROS~3\VC98\INCLUDE\istream.h(162) : warning C4003: not +enough actual parameters for macro 'PerlLIO_read' C:\PROGRA~1\MICROS~3\VC98\INCLUDE\istream.h(162) : warning C4003: not +enough actual parameters for macro 'PerlLIO_read' C:\PROGRA~1\MICROS~3\VC98\INCLUDE\ostream.h(91) : warning C4003: not e +nough actual parameters for macro 'PerlLIO_write' C:\PROGRA~1\MICROS~3\VC98\INCLUDE\ostream.h(92) : warning C4003: not e +nough actual parameters for macro 'PerlLIO_write' C:\PROGRA~1\MICROS~3\VC98\INCLUDE\ostream.h(93) : warning C4003: not e +nough actual parameters for macro 'PerlLIO_write' C:\PROGRA~1\MICROS~3\VC98\INCLUDE\ostream.h(126) : warning C4003: not +enough actual parameters for macro 'PerlLIO_write' C:\PROGRA~1\MICROS~3\VC98\INCLUDE\ostream.h(126) : warning C4003: not +enough actual parameters for macro 'PerlLIO_write' C:\PROGRA~1\MICROS~3\VC98\INCLUDE\ostream.h(127) : warning C4003: not +enough actual parameters for macro 'PerlLIO_write' C:\PROGRA~1\MICROS~3\VC98\INCLUDE\ostream.h(127) : warning C4003: not +enough actual parameters for macro 'PerlLIO_write' Coordinate.c(276) : fatal error C1004: unexpected end of file found
What do I do now? (ps: the book is back at the library ;()
Adding #include <math.h> and compiling manually (nomake) I get rid of the math.h related error, but the rest remain.
keep in mind this do compile on linux(debian).

btw, with perl5.8.0 the story is

Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. cp Coordinate.pm blib\lib\Coordinate.pm cp PerlCoordinate.pm blib\lib\PerlCoordinate.pm G:\Perl\bin\perl.exe G:\Perl\lib\ExtUtils/xsubpp -typemap G:\ +Perl\lib\ExtUtils\typemap -typemap typemap Coordinate.xs > Coordinat +e .xsc && G:\Perl\bin\perl.exe -MExtUtils::Command -e mv Coordinate.xsc +Coordinate.c Please specify prototyping behavior for Coordinate.xs (see perlxs manu +al) cl -c -TP -MD -DNDEBUG -O1 -DVERSION=\"0.01\" -DXS_VERS +ION=\"0.01\" "-IG:\Perl\lib\CORE" Coordinate.c Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for +80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. Coordinate.c G:\Perl\lib\CORE\win32.h(313) : error C2061: syntax error : identifier + 'Stat_t' G:\Perl\lib\CORE\win32.h(412) : error C2143: syntax error : missing ', +' before '*' G:\Perl\lib\CORE\win32.h(412) : error C2059: syntax error : '*' G:\Perl\lib\CORE\perlio.h(104) : error C2143: syntax error : missing ' +,' before '*' G:\Perl\lib\CORE\perlio.h(104) : error C2059: syntax error : '*' G:\Perl\lib\CORE\perlio.h(105) : error C2143: syntax error : missing ' +,' before '*' G:\Perl\lib\CORE\perlio.h(105) : error C2059: syntax error : '*' G:\Perl\lib\CORE\perlio.h(107) : error C2143: syntax error : missing ' +,' before '*' G:\Perl\lib\CORE\perlio.h(107) : error C2059: syntax error : '*' G:\Perl\lib\CORE\perlio.h(109) : error C2143: syntax error : missing ' +,' before '*' G:\Perl\lib\CORE\perlio.h(109) : error C2059: syntax error : '*' G:\Perl\lib\CORE\perlio.h(110) : error C2143: syntax error : missing ' +,' before '*' G:\Perl\lib\CORE\perlio.h(110) : error C2059: syntax error : '*' G:\Perl\lib\CORE\perlio.h(205) : error C2143: syntax error : missing ' +,' before '*' G:\Perl\lib\CORE\perlio.h(205) : error C2059: syntax error : '*' G:\Perl\lib\CORE\perlio.h(218) : error C2143: syntax error : missing ' +,' before '*' G:\Perl\lib\CORE\perlio.h(218) : error C2059: syntax error : '*' G:\Perl\lib\CORE\perlio.h(330) : error C2061: syntax error : identifie +r 'SV' G:\Perl\lib\CORE\perlio.h(333) : error C2061: syntax error : identifie +r 'SV' G:\Perl\lib\CORE\perlio.h(336) : error C2143: syntax error : missing ' +,' before '*' G:\Perl\lib\CORE\perlio.h(336) : error C2059: syntax error : '*' G:\Perl\lib\CORE\perlio.h(345) : error C2143: syntax error : missing ' +,' before '*' G:\Perl\lib\CORE\perlio.h(345) : error C2059: syntax error : '*' G:\Perl\lib\CORE\perlio.h(349) : error C2143: syntax error : missing ' +,' before '*' G:\Perl\lib\CORE\perlio.h(349) : error C2059: syntax error : '*' G:\Perl\lib\CORE\perlio.h(356) : error C2143: syntax error : missing ' +,' before '*' G:\Perl\lib\CORE\perlio.h(356) : error C2059: syntax error : '*' G:\Perl\lib\CORE\perlio.h(361) : error C2143: syntax error : missing ' +,' before '*' G:\Perl\lib\CORE\perlio.h(361) : error C2059: syntax error : '*' G:\Perl\lib\CORE\win32iop.h(72) : error C2061: syntax error : identifi +er 'Stat_t' G:\Perl\lib\CORE\win32iop.h(73) : error C2061: syntax error : identifi +er 'Stat_t' G:\Perl\lib\CORE\win32iop.h(76) : error C2061: syntax error : identifi +er 'IV' G:\Perl\lib\CORE\win32iop.h(132) : error C2061: syntax error : identif +ier 'Stat_t' G:\Perl\lib\CORE\dosish.h(130) : warning C4005: 'Stat' : macro redefin +ition G:\Perl\lib\CORE\win32.h(274) : see previous definition of 'St +at' G:\Perl\lib\CORE\perl.h(2002) : error C2146: syntax error : missing '; +' before identifier 'perl_os_thread' G:\Perl\lib\CORE\perl.h(2002) : fatal error C1004: unexpected end of f +ile found NMAKE : fatal error U1077: 'cl' : return code '0x2' Stop.
On a side note (relating to perlxs and c++) I have written an extension for wxperl (all c++, Wx-DialUpManager-0.01.tar.gz -- compiles fine, but not the final version DialUpManager), but it doesn't use iostream (and usually, neither does wxwindows).


MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
** The Third rule of perl club is a statement of fact: pod is sexy.


In reply to perlxs and c++ : dosish.h(111) : warning C4005: 'Stat' : macro redefinition by PodMaster

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.