Re: fatal error: tcl.h: No such file or directory

[email protected] ("S.J. Luo") Fri, 20 Jul 2018 01:27:28 +0800
Newsgroups perl.tcltk
Message-ID <CAMoHPCaECDigxLa8F-axF5Uy5cyBimivm_XNVXVsYOSqXJAkQw@mail.gmail.com>
--0000000000004da7a405715d7e09
Content-Type: text/plain; charset="UTF-8"

> but we do have these lines I Makefile.PL now:
>
> ...
> $incpath = $tclcfg{TCL_INCLUDE_SPEC};
>
> #
https://www.cpantesters.org/cpan/report/18397198-6bf4-1014-85e5-4e79f459b9c5
> # Tcl.xs:32:10: fatal error: tcl.h: No such file or directory
> if ($incpath) {
> my @tclh = grep {-f "$_/tcl.h"} $incpath=~/-I(\S+)/g;
> if ($#tclh==-1) {
> _die "incpath $incpath from your tclconfig $tclconfig does not provide
tcl.h"
> }
> } else {_die "can not figure out incpath from your tclconfig $tclconfig"}
>
> How come this happen to avoid my otherwise perfect check??

Hi,

I got some try on Strawberry Perl. I got similar result without installing
any tcl binary distribution.

----------
C:\strawberry\cpan\build\Tcl-1.16-0>perl Makefile.PL
'tclsh' is not recognized as an internal or external command,
operable program or batch file.
Use of uninitialized value $tclcfg{"tcl_library"} in pattern match (m//) at
Makefile.PL line 164.
Use of uninitialized value $tclver in substitution (s///) at Makefile.PL
line 171.
Use of uninitialized value $tclver in concatenation (.) or string at
Makefile.PL line 182.
LIBS   =  -ltcl
Use of uninitialized value $incpath in concatenation (.) or string at
Makefile.PL line 190.
INC    =
DEFINE =
tclConfig.sh =
Use of uninitialized value $incpath in string at Makefile.PL line 208.
Checking if your kit is complete...
Looks good
Warning (mostly harmless): No library found for -ltcl
Generating a dmake-style Makefile
Writing Makefile for Tcl
Writing MYMETA.yml and MYMETA.json

C:\strawberry\cpan\build\Tcl-1.16-0>dmake
cp Tcl.pm blib\lib\Tcl.pm
Running Mkbootstrap for Tcl ()
"C:\strawberry\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 644
"Tcl.bs"
"C:\strawberry\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty --
Tcl.bs blib\arch\auto\Tcl\Tcl.bs 644
"C:\strawberry\perl\bin\perl.exe" "C:\strawberry\perl\lib\ExtUtils\xsubpp"
 -typemap C:\strawberry\perl\lib\ExtUtils\typemap -typema
p C:\strawberry\cpan\build\Tcl-1.16-0\typemap  Tcl.xs > Tcl.xsc
Please specify prototyping behavior for Tcl.xs (see perlxs manual)
"C:\strawberry\perl\bin\perl.exe" -MExtUtils::Command -e mv -- Tcl.xsc Tcl.c
gcc -c          -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE
-DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv
-f
no-strict-aliasing -mms-bitfields -s -O2          -DVERSION=\"1.16\"
 -DXS_VERSION=\"1.16\"  "-IC:\strawberry\perl\lib\CORE"   Tcl
.c
Tcl.xs:32:17: fatal error: tcl.h: No such file or directory
 #include <tcl.h>
                 ^
compilation terminated.
dmake:  Error code 129, while making 'Tcl.o'
----------

The key is why it can pass the check Makefile.PL. In Strawberry Perl, the
following code got a weird result (Tcl.pm 1.16):

C:\strawberry\cpan\build\Tcl-1.16-0>perl -E "open(FH, 'foo |') or die; say
'I am still alive';"
I am still alive
'foo' is not recognized as an internal or external command,
operable program or batch file.

It seems open() with pipe returns true even if there is no 'foo' program
existed. I my Cygwin environment, the same program gets following result

% perl -E "open(FH, 'foo |') or die; say 'I am still alive';"
Died at -e line 1.

The Strawberry Perl I use is  5.24.4 x86_64 version in Win7.
The result in Tcl.pm 1.18
http://matrix.cpantesters.org/?dist=Tcl%201.18;os=mswin32;perl=5.28.0;reports=1
seems to be caused from the same issue.

SJ

--0000000000004da7a405715d7e09
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>&gt; but we do have these lines I Makefile.PL now:<br=
>&gt;<br>&gt; ...<br>&gt; $incpath =3D $tclcfg{TCL_INCLUDE_SPEC};<br>&gt;<b=
r>&gt; # <a href=3D"https://www.cpantesters.org/cpan/report/18397198-6bf4-1=
014-85e5-4e79f459b9c5">https://www.cpantesters.org/cpan/report/18397198-6bf=
4-1014-85e5-4e79f459b9c5</a><br>&gt; # Tcl.xs:32:10: fatal error: tcl.h: No=
 such file or directory<br>&gt; if ($incpath) {<br>&gt; my @tclh =3D grep {=
-f &quot;$_/tcl.h&quot;} $incpath=3D~/-I(\S+)/g;<br>&gt; if ($#tclh=3D=3D-1=
) {<br>&gt; _die &quot;incpath $incpath from your tclconfig $tclconfig does=
 not provide tcl.h&quot;<br>&gt; }<br>&gt; } else {_die &quot;can not figur=
e out incpath from your tclconfig $tclconfig&quot;}<br>&gt;<br>&gt; How com=
e this happen to avoid my otherwise perfect check??<br><br>Hi,<br><br>I got=
 some try on Strawberry Perl. I got similar result without installing any t=
cl binary distribution.<br><br>----------<br>C:\strawberry\cpan\build\Tcl-1=
.16-0&gt;perl Makefile.PL<br>&#39;tclsh&#39; is not recognized as an intern=
al or external command,<br>operable program or batch file.<br>Use of uninit=
ialized value $tclcfg{&quot;tcl_library&quot;} in pattern match (m//) at Ma=
kefile.PL line 164.<br>Use of uninitialized value $tclver in substitution (=
s///) at Makefile.PL line 171.<br>Use of uninitialized value $tclver in con=
catenation (.) or string at Makefile.PL line 182.<br>LIBS =C2=A0 =3D =C2=A0=
-ltcl<br>Use of uninitialized value $incpath in concatenation (.) or string=
 at Makefile.PL line 190.<br>INC =C2=A0 =C2=A0=3D<br>DEFINE =3D<br>tclConfi=
g.sh =3D<br>Use of uninitialized value $incpath in string at Makefile.PL li=
ne 208.<br>Checking if your kit is complete...<br>Looks good<br>Warning (mo=
stly harmless): No library found for -ltcl<br>Generating a dmake-style Make=
file<br>Writing Makefile for Tcl<br>Writing MYMETA.yml and MYMETA.json<br><=
br>C:\strawberry\cpan\build\Tcl-1.16-0&gt;dmake<br>cp Tcl.pm blib\lib\Tcl.p=
m<br>Running Mkbootstrap for Tcl ()<br>&quot;C:\strawberry\perl\bin\perl.ex=
e&quot; -MExtUtils::Command -e chmod -- 644 &quot;Tcl.bs&quot;<br>&quot;C:\=
strawberry\perl\bin\perl.exe&quot; -MExtUtils::Command::MM -e cp_nonempty -=
- Tcl.bs blib\arch\auto\Tcl\Tcl.bs 644<br>&quot;C:\strawberry\perl\bin\perl=
.exe&quot; &quot;C:\strawberry\perl\lib\ExtUtils\xsubpp&quot; =C2=A0-typema=
p C:\strawberry\perl\lib\ExtUtils\typemap -typema<br>p C:\strawberry\cpan\b=
uild\Tcl-1.16-0\typemap =C2=A0Tcl.xs &gt; Tcl.xsc<br>Please specify prototy=
ping behavior for Tcl.xs (see perlxs manual)<br>&quot;C:\strawberry\perl\bi=
n\perl.exe&quot; -MExtUtils::Command -e mv -- Tcl.xsc Tcl.c<br>gcc -c =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL=
_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -f<br=
>no-strict-aliasing -mms-bitfields -s -O2 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0-DVERSION=3D\&quot;1.16\&quot; =C2=A0 =C2=A0-DXS_VERSION=3D\&quot;1.16\&=
quot; =C2=A0&quot;-IC:\strawberry\perl\lib\CORE&quot; =C2=A0 Tcl<br>.c<br>T=
cl.xs:32:17: fatal error: tcl.h: No such file or directory<br>=C2=A0#includ=
e &lt;tcl.h&gt;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0^<br>compilation terminated.<br>dmake: =C2=A0Error code 129, while ma=
king &#39;Tcl.o&#39;<br>----------<br><br>The key is why it can pass the ch=
eck Makefile.PL. In Strawberry Perl, the following code got a weird result =
(Tcl.pm 1.16):<br><br><div style=3D"margin-left:40px">C:\strawberry\cpan\bu=
ild\Tcl-1.16-0&gt;perl -E &quot;open(FH, &#39;foo |&#39;) or die; say &#39;=
I am still alive&#39;;&quot;<br>I am still alive<br>&#39;foo&#39; is not re=
cognized as an internal or external command,<br>operable program or batch f=
ile.<br></div><br></div>It seems open() with pipe returns true even if ther=
e is no &#39;foo&#39; program existed. I my Cygwin environment, the same pr=
ogram gets following result<br><div><br><div style=3D"margin-left:40px">% p=
erl -E &quot;open(FH, &#39;foo |&#39;) or die; say &#39;I am still alive&#3=
9;;&quot;<br>Died at -e line 1.<br><br></div>The Strawberry Perl I use is=
=C2=A0 5.24.4 x86_64 version in Win7.<br></div><div>The result in Tcl.pm 1.=
18=C2=A0 <a href=3D"http://matrix.cpantesters.org/?dist=3DTcl%201.18;os=3Dm=
swin32;perl=3D5.28.0;reports=3D1">http://matrix.cpantesters.org/?dist=3DTcl=
%201.18;os=3Dmswin32;perl=3D5.28.0;reports=3D1</a>=C2=A0 seems to be caused=
 from the same issue.<br></div><div><br>SJ</div></div>

--0000000000004da7a405715d7e09--