Steve_BZ has asked for the wisdom of the Perl Monks concerning the following question:
Hi People,
I've been trying to install Inline::CPP to avoid having to re-write a large piece of C++ code and I'm having the following problem:
cpan[6]> install Inline::CPP
Running install for module 'Inline::CPP'
CPAN: Data::Dumper loaded ok (v2.121_12)
'YAML' not installed, falling back to Data::Dumper and Storable to rea
+d prefs 'C
:\Perl\cpan\prefs'
Running make for N/NE/NEILW/Inline-CPP-0.25.tar.gz
CPAN: Digest::SHA loaded ok (v5.47)
Checksum for C:\Perl\cpan\sources\authors\id\N\NE\NEILW\Inline-CPP-0.2
+5.tar.gz o
k
Scanning cache c:\Perl\cpan\build for sizes
........................................................--------------
+------DONE
DEL(1/5): C:\Perl\cpan\build\CPAN-1.9402-zZZmgH
DEL(2/5): C:\Perl\cpan\build\aliased-0.30-Ky0CzB
DEL(3/5): C:\Perl\cpan\build\Clone-0.31-H7WNkl
DEL(4/5): C:\Perl\cpan\build\Exporter-Tidy-0.07-VEBpAv
DEL(5/5): C:\Perl\cpan\build\Digest-SHA-5.47-E7jvVk
CPAN: Archive::Tar loaded ok (v1.42)
Inline-CPP-0.25/
Inline-CPP-0.25/grammar/
Inline-CPP-0.25/grammar/t/
Inline-CPP-0.25/grammar/t/07static.t
Inline-CPP-0.25/grammar/t/01nherit.t
Inline-CPP-0.25/grammar/t/16varlst.t
Inline-CPP-0.25/grammar/t/12retlst.t
Inline-CPP-0.25/grammar/t/14const.t
Inline-CPP-0.25/grammar/t/15stvar.t
Inline-CPP-0.25/grammar/t/03inline.t
Inline-CPP-0.25/grammar/t/02scope.t
Inline-CPP-0.25/grammar/t/04const.t
Inline-CPP-0.25/grammar/t/08anon.t
Inline-CPP-0.25/grammar/t/11minhrt.t
Inline-CPP-0.25/grammar/t/13vararg.t
Inline-CPP-0.25/grammar/t/10struct.t
Inline-CPP-0.25/grammar/t/06deflt.t
Inline-CPP-0.25/grammar/t/05virt.t
Inline-CPP-0.25/grammar/t/09purevt.t
Inline-CPP-0.25/grammar/grammar.pm
Inline-CPP-0.25/grammar/Makefile.PL
Inline-CPP-0.25/Changes
Inline-CPP-0.25/TESTED
Inline-CPP-0.25/MANIFEST
Inline-CPP-0.25/t/
Inline-CPP-0.25/t/01basic.t
Inline-CPP-0.25/t/02prefix.t
Inline-CPP-0.25/lib/
Inline-CPP-0.25/lib/Inline/
Inline-CPP-0.25/lib/Inline/CPP.pod
Inline-CPP-0.25/CPP.pm
Inline-CPP-0.25/README
Inline-CPP-0.25/Makefile.PL
CPAN: File::Temp loaded ok (v0.21)
Warning (usually harmless): 'YAML' not installed, will not store persi
+stent stat
e
CPAN.pm: Going to build N/NE/NEILW/Inline-CPP-0.25.tar.gz
Set up gcc environment - 3.4.5 (mingw special)
This will configure and build Inline::C++.
What default C++ compiler would you like to use? [g++] gcc
What default libraries would you like to include? [-lstdc++]
Checking if your kit is complete...
Looks good
Writing Makefile for Inline::CPP::grammar
Writing Makefile for Inline::CPP
Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. 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 ..
NEILW/Inline-CPP-0.25.tar.gz
C:\Perl\site\bin\nmake.EXE -- OK
Warning (usually harmless): 'YAML' not installed, will not store persi
+stent stat
e
Running make test
Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.
nmake -f Makefile all -nologo
cd ..
C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harn
+ess(0, 'bl
ib\lib', 'blib\arch')" t/*.t
t/01basic.....
Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.
C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils\xsubpp -typemap C:\
+Perl\lib\E
xtUtils\typemap -typemap C:\Perl\cpan\build\Inline-CPP-0.25-jUO8zP\_In
+line\build
\_01basic_t_5cd2\CPP.map _01basic_t_5cd2.xs > _01basic_t_5cd2.xsc &&
+C:\Perl\bi
n\perl.exe -MExtUtils::Command -e mv _01basic_t_5cd2.xsc _01basic_t_5c
+d2.c
gcc -c -IC:/Perl/cpan/build/Inline-CPP-0.25-jUO8zP/t -DNDEBU
+G -DWIN32
-D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DUSE_SITECUST
+OMIZE -DPR
IVLIB_LAST_IN_INC -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PE
+RLIO -DPER
L_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing -O2 -DVERSION=
+\"0.00\"
-DXS_VERSION=\"0.00\" "-IC:\Perl\lib\CORE" _01basic_t_5cd2.c
_01basic_t_5cd2.xs:2:22: iostream.h: No such file or directory
_01basic_t_5cd2.xs:4: error: syntax error before string constant
In file included from C:/Perl/lib/CORE/win32thread.h:4,
from C:/Perl/lib/CORE/perl.h:2611,
from _01basic_t_5cd2.xs:6:
C:/Perl/lib/CORE/win32.h:289: error: syntax error before "need"
_01basic_t_5cd2.xs:9: error: syntax error before '}' token
_01basic_t_5cd2.xs:16: error: syntax error before '{' token
_01basic_t_5cd2.xs:24: error: syntax error before ':' token
_01basic_t_5cd2.xs:28: error: syntax error before '}' token
_01basic_t_5cd2.xs:30: error: syntax error before ':' token
_01basic_t_5cd2.xs:36: error: syntax error before ':' token
_01basic_t_5cd2.xs:40: error: syntax error before ':' token
_01basic_t_5cd2.xs:44: error: syntax error before ':' token
_01basic_t_5cd2.c: In function `XS_main__Soldier_new':
_01basic_t_5cd2.c:80: error: `Soldier' undeclared (first use in this f
+unction)
_01basic_t_5cd2.c:80: error: (Each undeclared identifier is reported o
+nly once
_01basic_t_5cd2.c:80: error: for each function it appears in.)
_01basic_t_5cd2.c:80: error: `RETVAL' undeclared (first use in this fu
+nction)
_01basic_t_5cd2.c:82: error: `new' undeclared (first use in this funct
+ion)
_01basic_t_5cd2.c:82: error: syntax error before "Soldier"
_01basic_t_5cd2.c: In function `XS_main__Soldier_get_name':
_01basic_t_5cd2.c:103: error: `Soldier' undeclared (first use in this
+function)
_01basic_t_5cd2.c:103: error: `THIS' undeclared (first use in this fun
+ction)
_01basic_t_5cd2.c:108: error: syntax error before ')' token
_01basic_t_5cd2.c: In function `XS_main__Soldier_get_rank':
_01basic_t_5cd2.c:134: error: `Soldier' undeclared (first use in this
+function)
_01basic_t_5cd2.c:134: error: `THIS' undeclared (first use in this fun
+ction)
_01basic_t_5cd2.c:139: error: syntax error before ')' token
_01basic_t_5cd2.c: In function `XS_main__Soldier_get_serial':
_01basic_t_5cd2.c:165: error: `Soldier' undeclared (first use in this
+function)
_01basic_t_5cd2.c:165: error: `THIS' undeclared (first use in this fun
+ction)
_01basic_t_5cd2.c:170: error: syntax error before ')' token
_01basic_t_5cd2.c: In function `XS_main__Soldier_DESTROY':
_01basic_t_5cd2.c:196: error: `Soldier' undeclared (first use in this
+function)
_01basic_t_5cd2.c:196: error: `THIS' undeclared (first use in this fun
+ction)
_01basic_t_5cd2.c:199: error: syntax error before ')' token
_01basic_t_5cd2.c:206: error: `delete' undeclared (first use in this f
+unction)
_01basic_t_5cd2.c:206: error: syntax error before "THIS"
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code
+ '0x1'
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:\Perl\cpan\build\Inline-CPP-0.25-jUO8zP\_Inline\build\_01basic_t_5cd
+2
To debug the problem, cd to the build directory, and inspect the outpu
+t 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 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.
C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils\xsubpp -typemap C:\
+Perl\lib\E
xtUtils\typemap -typemap C:\Perl\cpan\build\Inline-CPP-0.25-jUO8zP\_In
+line\build
\_02prefix_t_4ede\CPP.map _02prefix_t_4ede.xs > _02prefix_t_4ede.xsc
+&& C:\Perl
\bin\perl.exe -MExtUtils::Command -e mv _02prefix_t_4ede.xsc _02prefix
+_t_4ede.c
gcc -c -IC:/Perl/cpan/build/Inline-CPP-0.25-jUO8zP/t -DNDEBU
+G -DWIN32
-D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DUSE_SITECUST
+OMIZE -DPR
IVLIB_LAST_IN_INC -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PE
+RLIO -DPER
L_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing -O2 -DVERSION=
+\"0.00\"
-DXS_VERSION=\"0.00\" "-IC:\Perl\lib\CORE" _02prefix_t_4ede.c
_02prefix_t_4ede.xs:2:22: iostream.h: No such file or directory
_02prefix_t_4ede.xs:4: error: syntax error before string constant
In file included from C:/Perl/lib/CORE/win32thread.h:4,
from C:/Perl/lib/CORE/perl.h:2611,
from _02prefix_t_4ede.xs:6:
C:/Perl/lib/CORE/win32.h:289: error: syntax error before "need"
_02prefix_t_4ede.xs:9: error: syntax error before '}' token
_02prefix_t_4ede.xs:17: error: field `dummy' declared as a function
_02prefix_t_4ede.xs:17: warning: no semicolon at end of struct or unio
+n
_02prefix_t_4ede.xs:17: error: syntax error before '{' token
_02prefix_t_4ede.c: In function `XS_main__Foo_dummy':
_02prefix_t_4ede.c:50: error: `Foo' undeclared (first use in this func
+tion)
_02prefix_t_4ede.c:50: error: (Each undeclared identifier is reported
+only once
_02prefix_t_4ede.c:50: error: for each function it appears in.)
_02prefix_t_4ede.c:50: error: `THIS' undeclared (first use in this fun
+ction)
_02prefix_t_4ede.c:55: error: syntax error before ')' token
_02prefix_t_4ede.c: In function `XS_main__Foo_new':
_02prefix_t_4ede.c:82: error: `Foo' undeclared (first use in this func
+tion)
_02prefix_t_4ede.c:82: error: `RETVAL' undeclared (first use in this f
+unction)
_02prefix_t_4ede.c:84: error: `new' undeclared (first use in this func
+tion)
_02prefix_t_4ede.c:84: error: syntax error before "Foo"
_02prefix_t_4ede.c: In function `XS_main__Foo_DESTROY':
_02prefix_t_4ede.c:105: error: `Foo' undeclared (first use in this fun
+ction)
_02prefix_t_4ede.c:105: error: `THIS' undeclared (first use in this fu
+nction)
_02prefix_t_4ede.c:108: error: syntax error before ')' token
_02prefix_t_4ede.c:115: error: `delete' undeclared (first use in this
+function)
_02prefix_t_4ede.c:115: error: syntax error before "THIS"
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code
+ '0x1'
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:\Perl\cpan\build\Inline-CPP-0.25-jUO8zP\_Inline\build\_02prefix_t_4e
+de
To debug the problem, cd to the build directory, and inspect the outpu
+t 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 List of Failed
----------------------------------------------------------------------
+---------
t/01basic.t 2 512 10 20 1-10
t/02prefix.t 2 512 4 8 1-4
Failed 2/2 test scripts. 14/14 subtests failed.
Files=2, Tests=14, 149 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00
+ CPU)
Failed 2/2 test programs. 14/14 subtests failed.
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code
+ '0x2'
Stop.
NEILW/Inline-CPP-0.25.tar.gz
C:\Perl\site\bin\nmake.EXE test -- NOT OK
Warning (usually harmless): 'YAML' not installed, will not store persi
+stent stat
e
Running make install
make test had returned bad status, won't install without force
Failed during this command:
NEILW/Inline-CPP-0.25.tar.gz : make_test NO
The problem might be related to a versioning problem, because in CPAN I first typed: install Inline CPP which installed version 0.46 of Inline. Followed by install Inline::CPP which installed version 0.25 of CPP.
Regards
Steve
Re: Inline:CPP module won't install
by Hue-Bond (Priest) on Apr 05, 2010 at 13:43 UTC
|
Set up gcc environment - 3.4.5 (mingw special)
This will configure and build Inline::C++.
What default C++ compiler would you like to use? [g++] gcc
What default libraries would you like to include? [-lstdc++]
Checking if your kit is complete...
I don't know much about your problem, but the fact that you answered gcc to the question about what g++ compiler to use just caught my attention.
--
David Serrano
(Please treat my english text just like Perl code, i.e. feel free to notify me of any syntax, grammar, style and/or spelling error. Thank you!).
| [reply] [d/l] [select] |
|
$ cat 832794.c
#include <iostream.h>
$ g++ -c 832794.c
In file included from /usr/include/c++/4.2/backward/iostream.h:31,
from 832794.c:1:
/usr/include/c++/4.2/backward/backward_warning.h:32:2: warning: #warni
+ng This file includes at least one deprecated or antiquated header. P
+lease consider using one of the 32 headers found in section 17.4.1.2
+of the C++ standard. Examples include substituting the <X> header for
+ the <X.h> header for C++ includes, or <iostream> instead of the depr
+ecated header <iostream.h>. To disable this warning use -Wno-deprecat
+ed.
$ gcc -c 832794.c
832794.c:1:22: error: iostream.h: No such file or directory
...which is exactly the first error the OP is getting:
_01basic_t_5cd2.xs:2:22: iostream.h: No such file or directory
(Just to be clear: the primary issue here is not the deprecation warning, but the fact that the path were iostream.h resides isn't being searched when gcc is used. The warning is just an indication that Inline::CPP is rather old/unmaintained.)
| [reply] [d/l] [select] |
Re: Inline:CPP module won't install
by Anonymous Monk on Apr 05, 2010 at 18:52 UTC
|
I have no issues when using g++,
$ cpanp i Inline::CPP
Installing Inline::CPP (0.25)
Running [C:\perl\5.10.1\bin\MSWin32-x86-multi-thread\perl.exe C:\perl\
+5.10.1\bin\cpanp-run-perl *snip*\CPANPL~1\510~1.1\build\Inline-CPP-0.
+25\Makefile.PL]...
This will configure and build Inline::C++.
What default C++ compiler would you like to use? [g++]
What default libraries would you like to include? [-lstdc++]
Checking if your kit is complete...
Looks good
Writing Makefile for Inline::CPP::grammar
Writing Makefile for Inline::CPP
Running [C:\perl\dmake-4.12-20090907-SHAY\dmake\dmake.EXE test]...
C:\perl\5.10.1\bin\MSWin32-x86-multi-thread\perl.exe "-MExtUtils::Comm
+and::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/01basic.t ... ok
t/02prefix.t .. ok
All tests successful.
Files=2, Tests=14, 19 wallclock secs ( 0.08 usr + 0.03 sys = 0.11 CP
+U)
Result: PASS
C:\perl\5.10.1\bin\MSWin32-x86-multi-thread\perl.exe "-MExtUtils::Comm
+and::MM" "-e" "test_harness(0, '..\blib\lib', '..\blib\arch')" t/*.t
t/01nherit.t .. ok
t/02scope.t ... ok
t/03inline.t .. ok
t/04const.t ... ok
t/05virt.t .... ok
t/06deflt.t ... ok
t/07static.t .. ok
t/08anon.t .... ok
t/09purevt.t .. ok
t/10struct.t .. ok
t/11minhrt.t .. ok
t/12retlst.t .. ok
t/13vararg.t .. ok
t/14const.t ... ok
t/15stvar.t ... ok
t/16varlst.t .. ok
All tests successful.
Files=16, Tests=34, 98 wallclock secs ( 0.09 usr + 0.02 sys = 0.11 C
+PU)
Result: PASS
You could try
Bug #45168 for Inline-CPP: The Makefile.PL does not properly set the library path on a mac. A patch is attached.
Bug #42552 for Inline-CPP: All tests fail on recent debian/g++ versions. "iostream.h" not found problem.
| [reply] [d/l] |
|
Hi Anon, this looks exactly like what I'm looking for. But it's way over my pay-grade.
update
When it says "Setting STD_IOSTREAM to a true value helps, and all tests pass nicely.", what is STD_IOSTREAM? Is it an environment variable (I'm doing this on windows, so is it system or user)? And what does 'true' value mean? It could be "1" or does it mean a path to iostream.h which exists?
I tried setting the system environment variable STD_IOSTREAM to '1' and running with compiler g++, but the results are the same. So I feel I must have misunderstood the patch process.
OK, well I finally understood what the patch was saying. I edited the CPP.pm files and Makefile.PL manually (is there an automatic way of doing it?) the 'Makefile.PL' runs smoothly as does 'nmake'. But 'nmake test' gives:
Thanks for all your efforts.
Regards
Steve
| [reply] [d/l] |
|
You're using gcc-3.4.5, so there should be no need to install the STD_IOSTREAM patch. One thing I would recommend is that you use 'dmake' (available from CPAN or, I think, as 'ppm install dmake'). That will at least remove that crappy old version of nmake you're using from the mix of things that could cause problems, though I doubt it's the problem here.
With 'dmake' installed, check that perl -V:make reports 'dmake'. (You may need to remove 'nmake.exe' from your path for that to happen.)
Then, in a freshly unpacked Inline-CPP-0.25 source folder, run 'perl Makefile.PL', accepting the prompts to use 'g++' and '-lstdc++'. Then run 'dmake test' and it should work ok.
It's not a good idea to have mingw in the msys tree .... I think that can cause problems with msys, though it shouldn't be a problem here. The simplest way to get both 'dmake' and 'mingw' for ActivePerl is to run 'ppm install MinGW' - doesn't require any path alterations or other fiddling about.
Let us know what, if any, errors arise - also the version of Parse::RecDescent that you installed.
Cheers, Rob
| [reply] [d/l] |
|
|
|
|