Perl

StrawberryPerl 5.32.0.1 & Tk CPAN 錯誤:未定義對 MAX 的引用

  • September 25, 2020

嘗試使用 StrawberryPerl 5.32.0.1 通過 CPAN 安裝 Tk,最後出現錯誤。嘗試了 32 位和 64 位版本,並得到相同的錯誤。這是相關行的輸出:

"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Mksymlists \
-e "Mksymlists('NAME'=>\"Tk\", 'DLBASE' => 'Tk', 'DL_FUNCS' => {  }, 'FUNCLIST' => [], 'IMPORTS' => {  }, 'DL_VARS' => []);"
g++ Tk.def -o blib\arch\auto\Tk\Tk.xs.dll -mdll -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib" Tk.o chnGlue.o encGlue.o evtGlue.o objGlue.o pTk\tkres.o tixGlue.o tkGlue.o tkGlue_f.o tkWin32Dll.o  pTk/libpTk.a "C:\STRAWB~1\perl\lib\CORE\libperl532.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libimm32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libcomctl32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libcomdlg32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libgdi32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libcomctl32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libimm32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libmoldname.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libkernel32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libuser32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libgdi32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libwinspool.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libcomdlg32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libadvapi32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libshell32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libole32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\liboleaut32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libnetapi32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libuuid.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libws2_32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libmpr.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libwinmm.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libversion.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libodbc32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libodbccp32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libcomctl32.a" -Wl,--enable-auto-image-base
C:/Strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: encGlue.o:encGlue.c:(.text+0x3f): undefined reference to `MAX'
C:/Strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: encGlue.o:encGlue.c:(.text+0x9f): undefined reference to `MAX'
C:/Strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: encGlue.o:encGlue.c:(.text+0x798): undefined reference to `MAX'
collect2.exe: error: ld returned 1 exit status
gmake: *** [Makefile:619: blib\arch\auto\Tk\Tk.xs.dll] Error 1
 SREZIC/Tk-804.035.tar.gz
 C:\STRAWB~1\c\bin\gmake.exe -- NOT OK
Stopping: 'install' failed for 'Tk'.
Failed during this command:
SREZIC/Tk-804.035.tar.gz                     : make NO

在草莓方面提出了一個錯誤:

https://rt.cpan.org/Public/Bug/Display.html?id=133260

引用自:https://serverfault.com/questions/1032298