Journal(2005) | Blog(2006) | RandomLink | WhoAmI | LiveBookmark | HomePage

<<Previous: 写模块给 CPAN 要注意的地方  >>Next: 在 Win32 下的 SourceForge Shell/CVS 登陆

在 Win32 下安装 Perl/Gtk2

Category: InstallNote   Keywords: Gtk2 Win32

参加了 Alexe 的项目 ShellWeb, 需要用到 Gtk2
所以是安装模块。CPAN 的话比较麻烦,而 ppm 比较简单。
run->cmd
ppm install http://gtk2-perl.sourceforge.net/win32/ppm/ExtUtils-Depends.ppd
ppm install http://gtk2-perl.sourceforge.net/win32/ppm/ExtUtils-PkgConfig.ppd
ppn install http://gtk2-perl.sourceforge.net/win32/ppm/Gtk2-GladeXML.ppd
ppm install http://gtk2-perl.sourceforge.net/win32/ppm/Glib.ppd
ppm install http://gtk2-perl.sourceforge.net/win32/ppm/Gtk2.ppd

Updated

Alexa 说可以从 http://gladewin32.sourceforge.net 下 Win32 版本的 GTK+
我试了下,果然简单了许多。
Thanks.

Abandoned

安装完模块还没完。因为我们还缺少 Gtk2 所需要的一些 dll 文件。
所以得去下载:
ftp://ftp.gtk.org/pub/gtk/v2.8/win32/
ftp://ftp.gtk.org/pub/gtk/v2.8/win32/atk-1.9.0.zip
ftp://ftp.gtk.org/pub/gtk/v2.8/win32/cairo-1.0.2.zip
ftp://ftp.gtk.org/pub/gtk/v2.8/win32/glib-2.8.4.zip
ftp://ftp.gtk.org/pub/gtk/v2.8/win32/gtk+-2.8.9.zip
ftp://ftp.gtk.org/pub/gtk/v2.8/win32/pango-1.10.1.zip
ftp://ftp.gtk.org/pub/gtk/v2.8/win32/dependencies/gettext-0.14.5.zip
ftp://ftp.gtk.org/pub/gtk/v2.8/win32/dependencies/libiconv-1.9.1.bin.woe32.zip
ftp://ftp.gtk.org/pub/gtk/v2.8/win32/dependencies/pkg-config-0.20.zip
ftp://ftp.gtk.org/pub/gtk/v2.8/win32/dependencies/zlib123-dll.zip
将这些下载回来的文件同时解压缩到一个文件夹。比如 E:/tools
然后在环境变量里添加 E:/tools/bin

我还有缺少一个文件。从 http://www.dll-files.com/dllindex/dll-files.shtml?libpng13 下载 libpng13.dll

然后试试运行下面的 pl 代码:

use Gtk2 -init;
# Gtk2->init; works if you didn't use -init on use
my $window = Gtk2::Window->new ('toplevel');
my $button = Gtk2::Button->new ('Quit');
$button->signal_connect (clicked => sub { Gtk2->main_quit });
$window->add ($button);
$window->show_all;
Gtk2->main;
如果幸运的话应该会有个 Gtk 窗口弹出来。不幸运的话看看还缺少什么 dll 文件。
一般在 ftp://ftp.gtk.org/pub/gtk/v2.8/win32/ftp://ftp.gtk.org/pub/gtk/v2.8/win32/dependencies/ 里能找到。实在找不到搜索 Google, http://www.dll-files.com/ 这个网站应该能找到。

Good luck!

<<Previous: 写模块给 CPAN 要注意的地方  >>Next: 在 Win32 下的 SourceForge Shell/CVS 登陆

Options: +Del.icio.us

Related items Created on 2005-12-21 23:28:54, Last modified on 2005-12-22 11:01:02
Copyright 2004-2005 All Rights Reserved. Powered by Eplanet && Catalyst 5.62.