Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Inline::CPP for Windows ActiveState

Reply
Thread Tools

Inline::CPP for Windows ActiveState

 
 
tuser
Guest
Posts: n/a
 
      05-07-2006
I am running Activestate Perl v 5.8.7 under Windows XP.

I have also got SWIG up and running OK with each of the two C++
compilers:
1. MS Visual C++ 6.0
2. Dev C++

....but I can't get Inline::CPP for Windows from the Activestate website
http://ppm.activestate.com/BuildStatus/5.8-I.html

because the build-status on their website has failed for Windows
http://ppm.activestate.com/BuildStat...e-CPP-0.25.txt

Does anybody know how to get Inline::CPP running under Windows for
ActiveState Perl ?

 
Reply With Quote
 
 
 
 
A. Sinan Unur
Guest
Posts: n/a
 
      05-07-2006
"tuser" <(E-Mail Removed)> wrote in
news:(E-Mail Removed) oups.com:

> I am running Activestate Perl v 5.8.7 under Windows XP.
>
> I have also got SWIG up and running OK with each of the two C++
> compilers:
> 1. MS Visual C++ 6.0
> 2. Dev C++


This is irrelevant and potentially confusing information, as I assume
you did not actually try to install Inline::CPP using these compilers.

I first skipped your question because I have neither of these installed.

> ...but I can't get Inline::CPP for Windows from the Activestate
> website http://ppm.activestate.com/BuildStatus/5.8-I.html
>
> because the build-status on their website has failed for Windows


So? You can always download the source, and try to install from source.

I am going to show you the process, so you can better diagnose problems
the next time.

D:\Home\asu1> cl
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for
80x86

D:\Home\asu1\UseNet\clpmisc> tar -xzvf Inline-CPP-0.25.tar.gz

....

D:\Home\asu1\UseNet\clpmisc> cd Inline-CPP-0.25

D:\Home\asu1\UseNet\clpmisc\Inline-CPP-0.25> perl Makefile.PL

D:\Home\asu1\UseNet\clpmisc\Inline-CPP-0.25> perl Makefile.PL
This will configure and build Inline::C++.
What default C++ compiler would you like to use? [cl -TP]

=for asu1

Change that to 'cl -TP -ML' (without the single quotes) if you are using
the free command line compiler from Microsoft.

=cut

What default libraries would you like to include? [MSVCIRT.LIB]

=for asu1

Change that to LIBC.LIB if you are using the free command line compiler
from Microsoft.

=cut

Checking if your kit is complete...
Looks good
Writing Makefile for Inline::CPP::grammar
Writing Makefile for Inline::CPP

D:\Home\asu1\UseNet\clpmisc\Inline-CPP-0.25> nmake -f Makefile

Microsoft (R) Program Maintenance Utility Version 1.60.5270
Copyright (c) Microsoft Corp 1988-1995. All rights reserved.

cp CPP.pm blib\lib\Inline\CPP.pm
cp lib/Inline/CPP.pod blib\lib\Inline\CPP.pod
NMAKE -f Makefile all -nologo
cp grammar.pm ..\blib\lib\Inline\CPP\grammar.pm
cd ..

=for asu1

Now, it is time to test:

= cut

D:\Home\asu1\UseNet\clpmisc\Inline-CPP-0.25> nmake -f Makefile test

Microsoft (R) Program Maintenance Utility Version 1.60.5270
Copyright (c) Microsoft Corp 1988-1995. All rights reserved.

NMAKE -f Makefile all -nologo
cd ..
C:\opt\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e"
"test_harness(0,
'blib\lib', 'blib\arch')" t/*.t
t/01basic.....
Microsoft (R) Program Maintenance Utility Version 1.60.5270
Copyright (c) Microsoft Corp 1988-1995. All rights reserved.

C:\opt\Perl\bin\perl.exe C:\opt\Perl\lib\ExtUtils\xsubpp -
typemap C:\op
t\Perl\lib\ExtUtils\typemap -typemap D:\Home\asu1\UseNet\clpmisc\Inline-
CPP-0.25
\_Inline\build\_01basic_t_5cd2\CPP.map _01basic_t_5cd2.xs > _01basic_t_
5cd2.xsc
&& C:\opt\Perl\bin\perl.exe -MExtUtils::Command -e mv _01basic_t_
5cd2.xsc _01ba
sic_t_5cd2.c
cl -TP -c -ID:/Home/asu1/UseNet/clpmisc/Inline-CPP-0.25/t -
nologo -GF
-W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -
DHAVE_DES_FCRYPT -DNO_H
ASH_SEED -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
-DUSE_P
ERLIO -DPERL_MSVCRT_READFIX -MD -Zi -DNDEBUG -O1 -DVERSION=\"0.00\"
-DXS_VER
SION=\"0.00\" "-IC:\opt\Perl\lib\CORE" _01basic_t_5cd2.c
_01basic_t_5cd2.c
_01basic_t_5cd2.xs(2) : fatal error C1083: Cannot open include file:
'iostream.h
': No such file or directory
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.

A problem was encountered while attempting to compile and install your
Inline
CPP code. The command that failed was:
nmake > out.make 2>&1

The build directory was:
D:\Home\asu1\UseNet\clpmisc\Inline-CPP-0.25\_Inline\build\_01basic_t_
5cd2

To debug the problem, cd to the build directory, and inspect the output
files.

at t/01basic.t line 30

=cut

As you can see, the error messages tell you exactly what went wrong. The
module refers to the deprecated iostream.h library.

Hmmmm ...

Let's try a shortcut without a real solution: Open up CPP.pm, and edit
the here document in sub validate by changing the lines with

#include <%iostream%>

to

#include <iostream>

Then,

D:\Home\asu1\UseNet\clpmisc\Inline-CPP-0.25> rm -rf _Inline

D:\Home\asu1\UseNet\clpmisc\Inline-CPP-0.25> nmake -f Makefile test

Microsoft (R) Program Maintenance Utility Version 1.60.5270
Copyright (c) Microsoft Corp 1988-1995. All rights reserved.

cp CPP.pm blib\lib\Inline\CPP.pm
Skip blib\lib\Inline\CPP.pod (unchanged)
NMAKE -f Makefile all -nologo
cd ..
C:\opt\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e"
"test_harness(0
'blib\lib', 'blib\arch')" t/*.t
t/01basic.....ok
t/02prefix....ok
All tests successful.
Files=2, Tests=14, 15 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00
CPU)
C:\opt\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e"
"test_harness(0
'..\blib\lib', '..\blib\arch')" t/*.t
t/01nherit....ok
t/02scope.....ok
t/03inline....ok
t/04const.....ok
t/05virt......ok
t/06deflt.....ok
t/07static....ok
t/08anon......ok
t/09purevt....ok
t/10struct....ok
t/11minhrt....ok
t/12retlst....ok
t/13vararg....ok
t/14const.....ok
t/15stvar.....ok
t/16varlst....ok
All tests successful.
Files=16, Tests=34, 10 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00
CPU)

Even thought this is a dirty hack, I think I am going to install the
module:

D:\Home\asu1\UseNet\clpmisc\Inline-CPP-0.25> nmake -f Makefile install

Microsoft (R) Program Maintenance Utility Version 1.60.5270
Copyright (c) Microsoft Corp 1988-1995. All rights reserved.

NMAKE -f Makefile all -nologo
cd ..
Installing C:\opt\Perl\html\site\lib\Inline\CPP.html
Installing C:\opt\Perl\site\lib\Inline\CPP.pm
Installing C:\opt\Perl\site\lib\Inline\CPP.pod
Installing C:\opt\Perl\site\lib\Inline\CPP\grammar.pm
Appending installation info to C:\opt\Perl\lib/perllocal.pod

Let's get a taste:

D:\Home\asu1\UseNet\clpmisc> rm -rf Inline-CPP-0.25*

D:\Home\asu1\UseNet\clpmisc> cat addcpp.pl
#!/usr/bin/perl

use strict;
use warnings;

use Inline CPP => <<END;
int add(int lhs, int rhs) {
return lhs + rhs;
}

END

print add(9, 15);


D:\Home\asu1\UseNet\clpmisc> addcpp
24

Sinan

--
--
A. Sinan Unur <(E-Mail Removed)>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc...uidelines.html

 
Reply With Quote
 
 
 
 
tuser
Guest
Posts: n/a
 
      05-08-2006
A. Sinan Unur wrote:
> So? You can always download the source, and try to install from source.
>
> I am going to show you the process, so you can better diagnose problems
> the next time.


Thanks very much for your help.

I have *almost* completed my installation of Inline::CPP:

At first I failed on the test (math.h(514) : error C2894: templates
cannot be declared to have 'C' linkage)

which I could fix by removing the EXTERN "C" directive in "CPP.pm"

but then I am failing on the last of the 16 tests
(16varlst_t_44e4.xs(31) : error C2258: illegal pure syntax, must be '=
0').

I don't know how to fix this.

Can you help ?

Here is a transcript of my installation procedure:

===================
for information:
before installing "Inline::CPP", I had to install "Parse::RecDescent"
(Parse-RecDescent-1.94.zip) and "Inline::C" (Inline-0.44.zip) directly
from the Activestate website.
"Parse-RecDescent-1.94.zip" installed just fine, but "Inline-0.44.zip"
was really, really nasty to install, I had to go to
"ExtUtils::MakeMaker-Hell" and back, but that's another story/post.
====================

C:\DosExt\Perl-Mod-Playground\Inline-CPP-0.25>cl
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for
80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

C:\DosExt\Perl-Mod-Playground\Inline-CPP-0.25>perl Makefile.PL
This will configure and build Inline::C++.
What default C++ compiler would you like to use? [cl -TP] cl -TP -ML
What default libraries would you like to include? [MSVCIRT.LIB]
LIBC.LIB
Checking if your kit is complete...
Looks good
Writing Makefile for Inline::CPP::grammar
Writing Makefile for Inline::CPP

C:\DosExt\Perl-Mod-Playground\Inline-CPP-0.25>nmake -f Makefile

Microsoft (R) Program Maintenance Utility Version 6.00.9782.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

cp CPP.pm blib\lib\Inline\CPP.pm
cp lib/Inline/CPP.pod blib\lib\Inline\CPP.pod
cp grammar.pm ..\blib\lib\Inline\CPP\grammar.pm

> Now, it is time to test:


C:\DosExt\Perl-Mod-Playground\Inline-CPP-0.25>nmake -f Makefile test

Microsoft (R) Program Maintenance Utility Version 6.00.9782.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib\lib', 'blib\arch')" t\01basic.t t\02prefix.t
t\01basic.....
Microsoft (R) Program Maintenance Utility Version 6.00.9782.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils/xsubpp -typemap
C:\Perl\lib\ExtUtils\typemap -typemap C:\DosExt\Perl-Mod-Playgrou
nd\Inline-CPP-0.25\_Inline\build\_01basic_t_5cd2\CPP.map
_01basic_t_5cd2.xs > _01basic_t_5cd2.xsc && C:\Perl\bin\perl.exe
-MExtUtil
s::Command -e mv _01basic_t_5cd2.xsc _01basic_t_5cd2.c
cl -TP -ML -c
-IC:/DosExt/Perl-Mod-Playground/Inline-CPP-0.25/t -nologo -Gf -W3 -MD
-Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -D
NO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DUSE_SITECUSTOMIZE
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCR
T_READFIX -MD -Zi -DNDEBUG -O1 -DVERSION=\"0.00\"
-DXS_VERSION=\"0.00\" "-IC:\Perl\lib\CORE" _01basic_t_5cd2.c
Command line warning D4025 : overriding '/ML' with '/MD'
_01basic_t_5cd2.c
C:\Program Files\Microsoft Visual Studio\VC98\include\math.h(514) :
error C2894: templates cannot be declared to have 'C' linkage
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.

A problem was encountered while attempting to compile and install your
Inline
CPP code. The command that failed was:
nmake > out.make 2>&1

The build directory was:
C:\DosExt\Perl-Mod-Playground\Inline-CPP-0.25\_Inline\build\_01basic_t_5cd2

To debug the problem, cd to the build directory, and inspect the output
files.

at t\01basic.t line 30
BEGIN failed--compilation aborted at t\01basic.t line 64.
t\01basic.....dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 1-10
Failed 10/10 tests, 0.00% okay
t\02prefix....
Microsoft (R) Program Maintenance Utility Version 6.00.9782.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils/xsubpp -typemap
C:\Perl\lib\ExtUtils\typemap -typemap C:\DosExt\Perl-Mod-Playgrou
nd\Inline-CPP-0.25\_Inline\build\_02prefix_t_4ede\CPP.map
_02prefix_t_4ede.xs > _02prefix_t_4ede.xsc && C:\Perl\bin\perl.exe
-MExtU
tils::Command -e mv _02prefix_t_4ede.xsc _02prefix_t_4ede.c
cl -TP -ML -c
-IC:/DosExt/Perl-Mod-Playground/Inline-CPP-0.25/t -nologo -Gf -W3 -MD
-Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -D
NO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DUSE_SITECUSTOMIZE
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCR
T_READFIX -MD -Zi -DNDEBUG -O1 -DVERSION=\"0.00\"
-DXS_VERSION=\"0.00\" "-IC:\Perl\lib\CORE" _02prefix_t_4ede.c
Command line warning D4025 : overriding '/ML' with '/MD'
_02prefix_t_4ede.c
C:\Program Files\Microsoft Visual Studio\VC98\include\math.h(514) :
error C2894: templates cannot be declared to have 'C' linkage
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.

A problem was encountered while attempting to compile and install your
Inline
CPP code. The command that failed was:
nmake > out.make 2>&1

The build directory was:
C:\DosExt\Perl-Mod-Playground\Inline-CPP-0.25\_Inline\build\_02prefix_t_4ede

To debug the problem, cd to the build directory, and inspect the output
files.

at t\02prefix.t line 0
INIT failed--call queue aborted.
t\02prefix....dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 1-4
Failed 4/4 tests, 0.00% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t\01basic.t 2 512 10 20 200.00% 1-10
t\02prefix.t 2 512 4 8 200.00% 1-4
Failed 2/2 test scripts, 0.00% okay. 14/14 subtests failed, 0.00% okay.
NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : return code '0x2'
Stop.

************************************************** ***********************************
I could see the problem in
C:\Program Files\Microsoft Visual Studio\VC98\include\math.h(514) :
error C2894: templates cannot be declared to have 'C' linkage
....and I promptly removed the EXTERN "C" directive in "CPP.pm".
I re-tested:
************************************************** ***********************************

C:\DosExt\Perl-Mod-Playground\Inline-CPP-0.25>nmake -f Makefile test

Microsoft (R) Program Maintenance Utility Version 6.00.9782.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

cp CPP.pm blib\lib\Inline\CPP.pm
Skip blib\lib\Inline\CPP.pod (unchanged)
C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib\lib', 'blib\arch')" t\01basic.t t\02prefix.t
t\01basic.....ok
t\02prefix....ok
All tests successful.
Files=2, Tests=14, 14 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00
CPU)
C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e"
"test_harness(0, '..\blib\lib', '..\blib\arch')" t\01nherit.t
t\02scope.
t t\03inline.t t\04const.t t\05virt.t t\06deflt.t t\07static.t
t\08anon.t t\09purevt.t t\10struct.t t\11minhrt.t t\12retlst.t t\13va
rarg.t t\14const.t t\15stvar.t t\16varlst.t
t\01nherit....ok
t\02scope.....ok
t\03inline....ok
t\04const.....ok
t\05virt......ok
t\06deflt.....ok
t\07static....ok
t\08anon......ok
t\09purevt....ok
t\10struct....ok
t\11minhrt....ok
t\12retlst....ok
t\13vararg....ok
t\14const.....ok
t\15stvar.....ok
t\16varlst....
Microsoft (R) Program Maintenance Utility Version 6.00.9782.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils/xsubpp -typemap
C:\Perl\lib\ExtUtils\typemap -typemap C:\DosExt\Perl-Mod-Playgrou
nd\Inline-CPP-0.25\grammar\_Inline\build\_16varlst_t_44e4\CPP.ma p
_16varlst_t_44e4.xs > _16varlst_t_44e4.xsc && C:\Perl\bin\perl.ex
e -MExtUtils::Command -e mv _16varlst_t_44e4.xsc _16varlst_t_44e4.c
cl -TP -ML -c
-IC:/DosExt/Perl-Mod-Playground/Inline-CPP-0.25/grammar/t -nologo -Gf
-W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CO
NSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DUSE_SITECUSTOMIZE
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPE
RL_MSVCRT_READFIX -MD -Zi -DNDEBUG -O1 -DVERSION=\"0.00\"
-DXS_VERSION=\"0.00\" "-IC:\Perl\lib\CORE" _16varlst_t_44e4.c
Command line warning D4025 : overriding '/ML' with '/MD'
_16varlst_t_44e4.c
_16varlst_t_44e4.xs(31) : error C2258: illegal pure syntax, must be '=
0'
_16varlst_t_44e4.xs(31) : error C2252: 'aa' : pure specifier can only
be specified for functions
_16varlst_t_44e4.xs(32) : error C2258: illegal pure syntax, must be '=
0'
_16varlst_t_44e4.xs(32) : error C2252: 'bb' : pure specifier can only
be specified for functions
_16varlst_t_44e4.xs(33) : error C2258: illegal pure syntax, must be '=
0'
_16varlst_t_44e4.xs(33) : error C2252: 'cc' : pure specifier can only
be specified for functions
_16varlst_t_44e4.xs(35) : error C2258: illegal pure syntax, must be '=
0'
_16varlst_t_44e4.xs(35) : error C2252: 'dd' : pure specifier can only
be specified for functions
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.

A problem was encountered while attempting to compile and install your
Inline
CPP code. The command that failed was:
nmake > out.make 2>&1

The build directory was:
C:\DosExt\Perl-Mod-Playground\Inline-CPP-0.25\grammar\_Inline\build\_16varlst_t_44e4

To debug the problem, cd to the build directory, and inspect the output
files.

at t\16varlst.t line 4
BEGIN failed--compilation aborted at t\16varlst.t line 35.
t\16varlst....dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 1-2
Failed 2/2 tests, 0.00% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t\16varlst.t 2 512 2 4 200.00% 1-2
Failed 1/16 test scripts, 93.75% okay. 2/34 subtests failed, 94.12%
okay.
NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
************************************************** ***********************************

I am failing on the last of the 16 tests (16varlst_t_44e4.xs(31) :
error C2258: illegal pure syntax, must be '= 0').

Can you help ?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble with activestate perl for windows Caduceus Perl 1 09-02-2007 12:14 AM
Progress bar under Windows XP/Activestate Perl George Perl Misc 6 03-05-2006 05:13 PM
Windows ActiveState Perl: MSXML transformNodeToObject finally succeeded tuser Perl Misc 4 02-19-2006 11:18 AM
ActiveState license: I can't distribute perl with my Windows application? Arvin Portlock Perl Misc 11 07-04-2005 09:19 PM
Ruby Windows installer, ActiveState Tcl Laurent Bossavit Ruby 0 11-13-2004 12:52 AM



Advertisments