Mike Janson <[EMAIL PROTECTED]> writes:
>Hello--I'm new to the list so I'll try and keep this brief.
We got your mail - but it seems nobody has a quick fix.
So here is my 2�:
Try removing the
extern "C" {
}
you have round the perl includes altogether.
I _think_ reasonably modern perl.h has the necessary
extern "C" itself (via EXTERN_C macro).
>
>I've been trying to write a XS which can be built on Linux and Win32. In
>trying the simple example at http://www.johnkeiser.com/perl-xs-c++.html,
>I've come up with an .XS that builds/works on Linux.
>
>However, when I try building on w2k with VC6 and ActiveState Active Perl
>5.6, I run into problems.
>
>I'm actually using the code *verbatim* from that page; when attempting
>"nmake" I get (sorry for formatting):
>
>C:\dev\xstest\MyPackage>nmake
>
>Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
>Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
>
> C:\Perl\bin\perl.exe -IC:\Perl\lib -IC:\Perl\lib
>C:\Perl\lib\ExtUtils/xs
>ubpp -C++ -typemap C:\Perl\lib\ExtUtils\typemap -typemap perlobject.map
>-typema
>p typemap MyPackage.xs > MyPackage.xsc && C:\Perl\bin\perl.exe
>-IC:\Perl\lib -IC
>:\Perl\lib -MExtUtils::Command -e mv MyPackage.xsc MyPackage.c
>Please specify prototyping behavior for MyPackage.xs (see perlxs manual)
> cl -TP -c -nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT
>-DHAV
>E_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
>-DPERL_MSVCRT_READFIX -
>O1 -MD -DNDEBUG -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\"
>-IC:\Perl\lib\CORE
> MyPackage.c
>MyPackage.c
>C:\PROGRA~1\MICROS~3\VC98\INCLUDE\math.h(514) : error C2894: templates
>cannot be
> declared to have 'C' linkage
>NMAKE : fatal error U1077: 'cl' : return code '0x2'
>Stop.
>
>C:\dev\xstest\MyPackage>
>
>
>It would appear math.h includes template defs--is there a workaround for
>this? I've tried #include'ing math.h before the extern "C", but then I
>get other issues with #include <streambuf> called from#include <iostream>.
>I'm afraid this email is too long already, but if appropriate I can
>explain in greater detail in a followup message.
>
>Thanks in advance,
>
>-Mike Janson
> mjanson (at) cvcg (dot) net
--
Nick Ing-Simmons
http://www.ni-s.u-net.com/