免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2841 | 回复: 6

CygWin环境中用cpanm安装模块失败 [复制链接]

论坛徽章:
1
未羊
日期:2014-09-08 22:47:27
发表于 2017-05-07 18:48 |显示全部楼层
在Windows10中安装了CygWin64,在用cpanm安装Moose模块时,出现如下错误:
  1. cpanm (App::cpanminus) 1.7041 on perl 5.022003 built for cygwin-thread-multi
  2. Work directory is /home/SunnyBoy/.cpanm/work/1494153804.9864
  3. You have make /usr/bin/make
  4. You have LWP 6.24
  5. You have /usr/bin/tar: tar (GNU tar) 1.29
  6. 由 Cygwin (1.29-1) 打包
  7. Copyright (C) 2015 Free Software Foundation, Inc.
  8. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  9. 这是自由软件:您可以自由地更改并重新发布它。
  10. 在法律所允许的范围内不含任何担保。

  11. 由 John Gilmore 和 Jay Fenlason 所写。
  12. Searching Moose () on cpanmetadb ...
  13. --> Working on Moose
  14. Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Moose-2.2005.tar.gz
  15. -> OK
  16. Unpacking Moose-2.2005.tar.gz
  17. Entering Moose-2.2005
  18. Checking configure dependencies from META.json
  19. Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.24)
  20. Checking if you have Dist::CheckConflicts 0.02 ... Yes (0.11)
  21. Configuring Moose-2.2005
  22. Running Makefile.PL
  23. HASCOMPILERt0FW/TESTWfJR.c:2:20: fatal error: EXTERN.h: No such file or directory

  24. #include "EXTERN.h"

  25.                     ^

  26. compilation terminated.

  27. Couldn't execute gcc -DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRICT_ANSI__ -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.3-1 -fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.3=/usr/src/debug/perl-5.22.3-1 -fwrapv -fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2 -O3 "-I/usr/lib/perl5/5.22/x86_64-cygwin-threads/CORE"   -c HASCOMPILERt0FW/TESTWfJR.c -o HASCOMPILERt0FW/TESTWfJR.o:  at Makefile.PL line 12.
  28. This distribution requires a working compiler at Makefile.PL line 12.
  29. -> N/A
  30. -> FAIL Configure failed for Moose-2.2005. See /home/SunnyBoy/.cpanm/work/1494153804.9864/build.log for details.
复制代码
看意思是说,找不到 EXTERN.h 这个文件,可在 lib/perl5/5.22/x86_64-cygwin-threads/CORE 这个文件夹下明明有的啊。

难道是什么环境变量没配置好,还是cpanm没配置好?请高手指点一下。

论坛徽章:
0
发表于 2017-05-08 17:57 |显示全部楼层
33. This distribution requires a working compiler at Makefile.PL line 12.


难道是没compiler

论坛徽章:
0
发表于 2017-05-16 00:07 |显示全部楼层

有可能,可能是需要gcc编译器。

win10下楼主不妨用Activeperl 或Strawberry。后者在http://strawberryperl.com/下载

论坛徽章:
12
子鼠
日期:2014-10-11 16:46:482016科比退役纪念章
日期:2018-03-16 10:24:0515-16赛季CBA联赛之山东
日期:2017-11-10 14:32:142016科比退役纪念章
日期:2017-09-02 15:42:4715-16赛季CBA联赛之佛山
日期:2017-08-28 17:11:5515-16赛季CBA联赛之浙江
日期:2017-08-24 16:55:1715-16赛季CBA联赛之青岛
日期:2017-08-17 19:55:2415-16赛季CBA联赛之天津
日期:2017-06-29 10:34:4315-16赛季CBA联赛之四川
日期:2017-05-16 16:38:55黑曼巴
日期:2016-07-19 15:03:112015亚冠之萨济拖拉机
日期:2015-05-22 11:38:5315-16赛季CBA联赛之北京
日期:2019-08-13 17:30:53
发表于 2017-05-16 09:39 |显示全部楼层
本帖最后由 523066680 于 2017-05-16 09:46 编辑

回复 3# hztj2005

缺少 gcc 一般不是这种提示。cygwin 一般也带有 gcc 。

回复楼主:
我感觉是环境变量的原因多一点。Makefile 里面有没有-I 添加头文件目录的选项,手动添加试试。
build.log 里面怎么写的?

论坛徽章:
12
子鼠
日期:2014-10-11 16:46:482016科比退役纪念章
日期:2018-03-16 10:24:0515-16赛季CBA联赛之山东
日期:2017-11-10 14:32:142016科比退役纪念章
日期:2017-09-02 15:42:4715-16赛季CBA联赛之佛山
日期:2017-08-28 17:11:5515-16赛季CBA联赛之浙江
日期:2017-08-24 16:55:1715-16赛季CBA联赛之青岛
日期:2017-08-17 19:55:2415-16赛季CBA联赛之天津
日期:2017-06-29 10:34:4315-16赛季CBA联赛之四川
日期:2017-05-16 16:38:55黑曼巴
日期:2016-07-19 15:03:112015亚冠之萨济拖拉机
日期:2015-05-22 11:38:5315-16赛季CBA联赛之北京
日期:2019-08-13 17:30:53
发表于 2017-05-16 09:52 |显示全部楼层
WIN7 64位 Strawberry Perl V5.24 Portable Edition
在命令行 perl Makefile.PL,也会提示
This distribution requires a working compiler at Makefile.PL line 12.
但没有提示缺少某个库。

改从 草莓Perl Portable Edition 自带的 portableshell.bat 打开终端,安装成功~

论坛徽章:
1
未羊
日期:2014-09-08 22:47:27
发表于 2017-05-16 20:02 |显示全部楼层
回复 4# 523066680
我第一个帖子贴的那个文本文件,就是build.log的内容。



论坛徽章:
0
发表于 2017-05-17 00:40 |显示全部楼层
523066680 发表于 2017-05-16 09:39
回复 3# hztj2005

缺少 gcc 一般不是这种提示。cygwin 一般也带有 gcc 。

Makefile 里面有没有-I 添加头文件目录的选项,手动添加试试。

-I在代表什么?一般是没有这么个目录名的。

楼主CygWin、perl安装的目录名中是否有空格或者汉字之类?

我以前用CygWin,印象中遇到过一次这种原因造成的问题。


您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP