是否有人设法在Windows(Win7)上为Perl(5.10)安装GD
模块?请注意,不幸的是,这既不是ActivePerl也不是Strawberry Perl;相反,它是使用MinGW自编的。我已经解压GD库C:\Opt\GDlib
。有bin
,lib
和include
目录。如何在Windows上安装Perl的GD图形库?
我有坐在C:\Opt\MinGW\bin\*.exe
的MinGW工具,包括gcc
和mingw32-make.exe
(但没有明文make
)。
我正在运行Microsoft脚本来设置INCLUDE
,LIBPATH
和LIB
。
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"
如果我不这样做,报告下面的Windows库丢失,当我运行perl Makefile.PL
:
oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib
运行Microsoft脚本后,只有以下报道:
Note (probably harmless): No library found for -lfreetype Note (probably harmless): No library found for -ljpeg Note (probably harmless): No library found for -lpng Note (probably harmless): No library found for -lz
即使我将C:\Opt\GDlib\bin
添加到PATH
时,该警告仍然存在,因此会找到GD二进制文件。
我甚至不确定哪个可以打电话:mingw32-make
,dmake
或make
可能仍然会丢失?这里是我看到的错误输出:
C:\.cpan\build\GD-2.46-baFt6a :: mingw32-make mingw32-make: *** No rule to make target `C:\epages\Perl\libConfig.pm', needed by `Makefile'. Stop. C:\.cpan\build\GD-2.46-baFt6a :: dmake dmake.exe: Error: -- `C:\epages\Perl\libConfig.pm' not found, and can't be made
我会感谢任何能够阐明我应该在这里做什么的人。我怀疑我错过了如何在Windows上使用MinGW进行编译的基础知识。
更新 - 继尼尔的建议给TDM-GCC一试
这里的屏幕输出。仍然没有成功,但我想这只是我忽略了一些琐事。最后,GD模块已经为草莓和ActiveState构建了,所以肯定有办法。
vsvars32
set path=%path%;C:\Opt\GDlib\bin
cpan
然后在CPAN命令:
cpan[1]> look GD
CPAN: Storable loaded ok (v2.18)
Going to read \.cpan\Metadata
Database was generated on Wed, 25 May 2011 13:37:34 GMT
CPAN: YAML loaded ok (v0.72)
Going to read \.cpan\build/
............................................................................DONE
Found 13 old builds, restored the state of 11
Running look for module 'GD'
Trying to open a subshell in the build directory...
Working directory is \.cpan\build\GD-2.46-baFt6a
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.
C:\.cpan\build\GD-2.46-baFt6a :: perl Makefile.PL
Notice: Type perl Makefile.PL -h for command-line option summary.
Der Befehl "gdlib-config" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
**UNRECOVERABLE ERROR**
Could not find gdlib-config in the search path. Please install libgd 2.0.28 or higher.
If you want to try to compile anyway, please rerun this script with the option --ignore_missing_gd.
C:\.cpan\build\GD-2.46-baFt6a :: perl Makefile.PL --ignore_missing_gd
Der Befehl "gdlib-config" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Where is libgd installed? [/usr/lib] C:\opt\gdlib
Please choose the features that match how libgd was built:
Build JPEG support? [y]
Build PNG support? [y]
Build FreeType support? [y]
Build GIF support? [y]
Build support for animated GIFs? [y]
If you experience compile problems, please check the @INC, @LIBPATH and @LIBS
arrays defined in Makefile.PL and manually adjust, if necessary.
Note (probably harmless): No library found for -lfreetype
Note (probably harmless): No library found for -ljpeg
Note (probably harmless): No library found for -lpng
Note (probably harmless): No library found for -lz
Writing Makefile for GD
C:\.cpan\build\GD-2.46-baFt6a :: which mingw32-make
C:\Opt\MinGW32-TDM-GCC\bin\mingw32-make.EXE
C:\.cpan\build\GD-2.46-baFt6a :: mingw32-make
mingw32-make: *** No rule to make target `C:\epages\Perl\libConfig.pm', needed by `Makefile'. Stop.
谢谢,思南。同时,我已经离开这个环境(毕竟是三年前),对GD的需求消失了,所以我不会把你的建议付诸实践。不过,你的建议是健全的。当我问这个问题时,我对构建问题毫无头绪。 – Lumi 2014-10-08 19:49:42