2011-05-25 37 views
0

是否有人設法在Windows(Win7)上爲Perl(5.10)安裝GD模塊?請注意,不幸的是,這既不是ActivePerl也不是Strawberry Perl;相反,它是使用MinGW自編的。我已經解壓GD庫C:\Opt\GDlib。有bin,libinclude目錄。如何在Windows上安裝Perl的GD圖形庫?

我有坐在C:\Opt\MinGW\bin\*.exe的MinGW工具,包括gccmingw32-make.exe(但沒有明文make)。

我正在運行Microsoft腳本來設置INCLUDE,LIBPATHLIB

"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,dmakemake可能仍然會丟失?這裏是我看到的錯誤輸出:

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. 

回答

0

你必須建立和安裝基本libgd這Perl的GD,還有other libraries使用您的構建環境中提到(使用相同的編譯器和設置用於製作perl)。

您不應該將您的VC環境與MinGW混用。

我寧願堅持使用與Windows SDK 7.1捆綁在一起的編譯器/構建工具,從構建源代碼開始。

+0

謝謝,思南。同時,我已經離開這個環境(畢竟是三年前),對GD的需求消失了,所以我不會把你的建議付諸實踐。不過,你的建議是健全的。當我問這個問題時,我對構建問題毫無頭緒。 – Lumi 2014-10-08 19:49:42

0

聽起來可能是您的MinGW的安裝問題。你從哪裏得到的?您應該試試http://tdm-gcc.tdragon.net的版本。此外,該.bat文件適用於Microsoft編譯器,不適用於MinGW。

+0

謝謝 - 我從[SourceForge](http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/mingw-get-inst-20110316/)獲得了我的MinGW,看起來是[MinGW主頁](http://www.mingw.org/wiki/Getting_Started)的鏈接。我會試一試你的建議。 – Lumi 2011-05-25 15:41:50

+0

MinGW的主頁非常好用 - TDM的構建非常好。 – 2011-05-25 15:44:31

+0

我已經使用TDM更新了我的問題,使用了cpan shell會話的記錄。仍然沒有成功。我想知道'perl Makefile.PL'是否生成了'Makefile'的正確風格?哦,我認爲它沒有。它有這樣一行:'MAKE = nmake' – Lumi 2011-05-25 16:29:13