是否有人設法在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