使用CPAN进行Tk安装

使用CPAN进行Tk安装

本文介绍了使用CPAN进行Tk安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过使用Tk模块在perl中编写GUI.因此,我要安装Tk模块.

I want to write GUI in perl by using the Tk module. Therefore, I want to install Tk module.

我打开了一个命令窗口,然后键入"cpan Tk".几分钟后,运行结束,然后在命令窗口中收到以下消息:

I opened a command window, and typed "cpan Tk". After a few minutes the run was over and then I got the following message on the command window:

" windres不被识别为内部或外部命令,可操作程序或批处理文件.dmake.exe:错误代码129,同时制作'tkres.o'dmake.exe:错误代码255,同时制作'pTk \ libpTk.a'SREZIC/Tk-804.032.tar.gz C:\ Perl64 \ site \ bin \dmake.exe –不好"

""windres' is not recognized as an internal or external command, operable program or batch file. dmake.exe: Error code 129, while making 'tkres.o' dmake.exe: Error code 255, while making 'pTk\libpTk.a' SREZIC/Tk-804.032.tar.gz C:\Perl64\site\bin\dmake.exe -- NOT OK"

显然,安装进行得不好.我还尝试执行一个包含"use Tk"行的perl脚本,并得到以下消息:

Apparently, the installation didn't go well. I also tried to execute a perl script that contains the line "use Tk" and I got the following message:

"无法在@INC中找到Tk.pm(您可能需要安装Tk模块)(@INC在file.pl第1行包含s:C:/Perl64/site/lib C:/Perl64/lib.)BEGIN失败-在file.pl第1行中中止编译."

""Can't locate Tk.pm in @INC (you may need to install the Tk module)(@INC contain s: C:/Perl64/site/lib C:/Perl64/lib .) at file.pl line 1. BEGIN failed--compilation aborted at file.pl line 1."

您能帮我正确安装Tk吗?

Can you help me install Tk properly?

推荐答案

使用命令 perl -MCPAN -e"shell" 安装CPAN模块后,将路径 c:\ Perl \ site \ lib \ auto \ MinGW \ bin 添加到系统PATH,然后使用CPAN控制台重新启动窗口.

After installing CPAN module with command perl -MCPAN -e "shell",add path c:\Perl\site\lib\auto\MinGW\bin to system PATH and restart window with CPAN console.

然后CPAN控制台中的命令"制作Tk ","测试Tk "和"安装Tk "应该可以使用.

Then commands 'make Tk', 'test Tk' and 'install Tk' in CPAN console should work.

这篇关于使用CPAN进行Tk安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 00:31