在Windows上安装CPAN模块

发布于 2024-10-05 12:39:25 字数 2305 浏览 7 评论 0原文

我正在尝试在 Windows 7 上安装 CPAN 模块。我没有 Active Perl,因此无法使用 PPM 包。

所有站点上给出的步骤都包括这三个步骤:make、make test 和 make install。我知道 make 是 unix 命令,不能在 Windows 上运行。

我应该在 Windows 上运行什么命令来完成安装?

我从 CPAN 的网站下载了 dmake,正如其中一个网站提到的那样,但是当我运行它时,它给出了以下错误 -

D:\Parse-RecDescent-1.965001.tar\Parse-RecDescent-1.965001>D:\dmake\dmake\dmake dmake:错误:-- `D:\indigoampp\perl-5.12.1\libConfig.pm' 找不到,也无法制作

请让我知道如何完成这些步骤。谢谢!

PS:再说一次,PPM 不是一个选择。


谢谢大家。

indigoampp\perl-5.12.1\lib 位置有一个名为 Config_heavy.pl 的文件。它有一行:make='nmake'。我将其更改为 make='dmake' 因为我正在使用 dmake 命令。

此后,我不需要更改每个模块的 Makefile 中的 DIRFILESEP。它现在正在生成 \\,如上述链接中所述。

所以我现在可以运行 dmake、dmake test 和 dmake install。然而它没有做任何事情。它没有复制各个位置的 pm 文件。为什么会这样??

不管怎样,我手动复制了 pm 文件,希望一切都能正常工作。不过,我以前也能做到。为什么我运行 makefile.pl 和 dmake 命令?

另外,我的目标是安装 Apache2::Request 模块。我发现它依赖于多个模块。我下载了这些模块并为它们运行了上面的命令 - 没有错误。最后,当我对 Apache2::Request 模块运行这些步骤时,我在 dmake 命令中收到以下错误:

D:\libapreq2-2.12.tar\libapreq2-2.12>dmake
dmake:  makefile:  line 25:  Warning: -- Duplicate target [Release]
dmake:  makefile:  line 25:  Warning: -- Duplicate target [Release]
dmake:  makefile:  line 25:  Warning: -- Duplicate target [!=]
dmake:  makefile:  line 25:  Error: -- Expecting macro or rule defn, found neith
er

我在 libapreq2-2.12.tar\libapreq2-2.12 文件夹下的 Makefile 中没有发现任何可疑内容。 Makefile 的部分内容(错误行周围)是:

LIBAPREQ=libapreq2
APREQ2_TEST=apreq2_test
CGITEST=test_cgi
MOD=mod_apreq2

!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE 
!MESSAGE NMAKE CFG="Release"
!MESSAGE 
!MESSAGE Possible choices for configuration are:
!MESSAGE 
!MESSAGE "Release" (based on "Win32 (x86) Console Application")
!MESSAGE "Debug" (based on "Win32 (x86) Console Application")
!MESSAGE 
!ERROR An invalid configuration is specified.
!ENDIF 

!IF "$(APACHE)" == ""
!MESSAGE No Apache directory was specified.
!MESSAGE Please run Configure.bat to specify a valid Apache directory.
!ERROR
!ENDIF

任何人都可以帮忙解决这个问题吗?上面的问题(为什么它没有自动复制 pm 文件)?感谢您抽出时间!

I am trying to install CPAN module on Windows 7. I don't have Active Perl so can't use PPM package.

The steps given on all sites include these three steps: make, make test and make install. I know that make is unix command and won't run on Windows.

What command I shall run on Windows to complete installation?

I downloaded dmake from CPAN's site as mentioned by one of the site but when I run it, it gives following error -

D:\Parse-RecDescent-1.965001.tar\Parse-RecDescent-1.965001>D:\dmake\dmake\dmake
dmake: Error: --
`D:\indigoampp\perl-5.12.1\libConfig.pm'
not found, and can't be made

Please let me know how shall I complete these steps. Thanks!

PS: Again, PPM is not an option.


Thanks everyone.

There is a file called Config_heavy.pl at indigoampp\perl-5.12.1\lib location. It had a line: make='nmake'. I changed that to make='dmake' as I am using dmake commands.

After this, I didn't need to change DIRFILESEP in Makefile of each module. It is now generating \\ as mentioned in of the above links.

So I can run dmake, dmake test and dmake install now. However it doesn't do anything. It didn't copy pm file/files at respective locations. Why so??

Anyway, I manually copied pm file/files in hope that everything should work. However that I could do before as well. Why did I run makefile.pl and dmake commands??

Also, my aim was to install Apache2::Request module. I found that it's dependent on multiple modules. I downloaded those modules and ran above commands for them - no error as such. In the end, when I ran these steps for Apache2::Request module, I get following error in dmake command:

D:\libapreq2-2.12.tar\libapreq2-2.12>dmake
dmake:  makefile:  line 25:  Warning: -- Duplicate target [Release]
dmake:  makefile:  line 25:  Warning: -- Duplicate target [Release]
dmake:  makefile:  line 25:  Warning: -- Duplicate target [!=]
dmake:  makefile:  line 25:  Error: -- Expecting macro or rule defn, found neith
er

I don't find anything suspicious in Makefile under libapreq2-2.12.tar\libapreq2-2.12 folder. The partical content of Makefile (around the error line) is:

LIBAPREQ=libapreq2
APREQ2_TEST=apreq2_test
CGITEST=test_cgi
MOD=mod_apreq2

!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE 
!MESSAGE NMAKE CFG="Release"
!MESSAGE 
!MESSAGE Possible choices for configuration are:
!MESSAGE 
!MESSAGE "Release" (based on "Win32 (x86) Console Application")
!MESSAGE "Debug" (based on "Win32 (x86) Console Application")
!MESSAGE 
!ERROR An invalid configuration is specified.
!ENDIF 

!IF "$(APACHE)" == ""
!MESSAGE No Apache directory was specified.
!MESSAGE Please run Configure.bat to specify a valid Apache directory.
!ERROR
!ENDIF

Can anyone help with this & above question (why it didn't copy pm files automatically)? Thanks for your time!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

酷到爆炸 2024-10-12 12:39:25

看起来您正在使用 Indigo Perl。根据他们的网站,他们有自己的包管理器,称为 IPM - 你尝试过吗?

但对于 Windows Perl 工作,我真的建议您查看 Strawberry Perl

Looks like you're using Indigo Perl. According to their web site, they have their own package manager called IPM - have you tried that?

But for Windows Perl work, I'd really recommend looking at Strawberry Perl.

楠木可依 2024-10-12 12:39:25

有时要安装 Perl 模块,您所需要做的就是将 .pm 文件复制到 perl/site 或 perl/lib 中的相应目录。安装 Perl 模块的标准过程总是涉及运行“make”,但在许多情况下,“make”所做的只是将 .pm 文件复制到 perl/site 或 perl/lib。但是,当 Perl 模块需要对 Windows 库进行低级访问时,您需要的不仅仅是“make”,还需要整个 C 工具链。

如果 ActiveState Perl 反对您的宗教信仰,请考虑下载并安装 Cygwin 环境。选择 Perl 和 C 开发工具(称为 binutils)进行 Cygwin 安装。

但我告诉你,ActiveState Perl 很难被击败。它是 Windows 平台上最完整的 Perl 解决方案。而且它是免费的!

Sometimes to install a Perl module, all you need do is copy the .pm file to the appropriate directory in perl/site or perl/lib. The standard procedure for installing a Perl module always involves running 'make', but in many cases, all the 'make' does is to copy the .pm file to perl/site or perl/lib. But when the Perl module needs low level access to the Windows libraries, then you need more than just 'make', you need a whole C tool chain.

If ActiveState Perl is against your religion, then consider downloading and installing a Cygwin environment. Select Perl and the C development tools (called binutils) for the Cygwin install.

But I tell ya, its hard to beat ActiveState Perl. It is the most complete Perl solution for a Windows platform. And its free!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文