[英]Why can't I install SDL on any of my portable perl installations on windows?
在學校,我們被告知要用我們選擇的語言做一個私人項目。 我選擇了perl,並為圖形(必選組件)選擇了SDL。
之前我安裝了Portable-git,而perl附帶了git-bash東西。 萬歲! 有效! 讓我們安裝sdl!
cpan SDL
輸出:
Can't locate CPAN/Author.pm in @INC (you may need to install the CPAN::Author module)
這讓我感到困惑,尤其是當我收到cpan CPAN::Author
的相同消息時。 因此,我安裝了便攜式的Strawberry-Perl版本(學校計算機安全設置,禁止非管理員安裝軟件),並且在加載了很多東西之后,我得到了另一條錯誤消息:
Welcome to Alien::SDL module installation
-----------------------------------------
checking operating system... MSWin32
checking for gcc... yes
checking build system type... MSWin32-x64-multi-thread
checking platform specific module... using 'My::Builder::Windows'
checking SDL_INST_DIR env var... no
checking for config script... no
checking for prebuilt binaries... no
You have the following options:
[1] Quit installation
What way do you wanna go? [1 ]1
No 'Build' created FROGGS/Alien-SDL-1.446.tar.gz
C:\Users\gardner.mark.INFOLAB\Downloads\strawberry-perl\perl\bin\perl.exe
Build.PL -- NOT OK Stopping: 'install' failed for
'Alien::SDL'.
我已經嘗試了cpan Alien::SDL
,並且在兩個命令上都使用了-f標志,但是我仍然得到相同的消息。 我是否需要安裝其他東西,還是有什么問題?
編輯:如@xxfelixxx建議,我成功安裝了cpanm。 但是,這會給出以下輸出,並帶有錯誤(粗體):
--> Working on SDL
Fetching http://www.cpan.org/authors/id/F/FR/FROGGS/SDL-2.548.tar.gz ... OK
==> Found dependencies: Alien::SDL, Tie::Simple
--> Working on Alien::SDL
Fetching http://www.cpan.org/authors/id/F/FR/FROGGS/Alien-SDL-1.446.tar.gz... OK
Configuring Alien-SDL-1.446 ... N/A
! Configure failed for Alien-SDL-1.446. See [...]\STRAWB~1\data\.cpanm\work\1527577290.7232\build.log for details.
--> Working on Tie::Simple
Fetching http://www.cpan.org/authors/id/H/HA/HANENKAMP/Tie-Simple-1.04.tar.gz ... OK
Configuring Tie-Simple-1.04 ... OK
Building and testing Tie-Simple-1.04 ... OK
Successfully installed Tie-Simple-1.04
! Installing the dependencies failed: Module 'Alien::SDL' is not installed
! Bailing out the installation for SDL-2.548.
1 distribution installed
因此,如前所述,Alien :: SDL無法自我配置。
對topicstarter的簡短回答:
SDL 1.x庫和Alien:SDL perl模塊似乎都沒有維護,每個人都去了SDL2和Alien :: SDL2
您也應該如此。
我安裝了Strawberry 5.30 Win64,然后解決了文件/文件夾訪問權限的明顯問題,因為我不想以管理員用戶身份運行Perl或Perl游戲。
然后,我剛剛發出Windows shell命令cpan install Alien:SDL2
它的安裝就像一個魅力。
另外,似乎也可以安裝Alien:SDL version 1
但這需要草莓Perl的Win32 / x86版本,而不是Win64 / x64版本。 但為什么? 根據http://yapgh.blogspot.com,該SDL v.1自2013年3月起已失效。
只需添加更多詳細信息。
也被這個擊中了...
我的願望只是在Win10 x64盒子上運行Frozen Bubbles游戲。
我有一些編程經驗,但是沒有Perl的經驗,也沒有Perl IDE或其他東西。
我不想讓任何Perl編程麻煩,我只想讓游戲運行。
我從Google那里收到了同樣的錯誤消息,因此這可能對其他人也有幫助,Google可能也會在這里轉發。
就像我說的,SDL 1.x庫和Alien:SDL perl模塊是不需要維護的。
但是,FrozenBubble游戲已不再維護,僅適用於SDL1.x。
CPAN測試在Windows上有Alien :: SDL的以下記錄: http : //www.cpantesters.org/cpan/report/154af118-6c11-1014-a593-b7c73b50a26f
值得注意的事情:
因此似乎可以質疑,GCC 7.1和8.3的Win64的ABI是否相同。
該文件似乎觸發了錯誤:
它有$prebuilt_binaries
數組,其中列出了一些-Whd'ya認為嗎? -預先構建的SDL 1.x庫。 對於Win32預建SDL1.x,它具有3個選項,對於Win64,它具有兩個選項:
BEWARE: binaries are using old ABI
just for old strawberryperl 5.12.x/64bit
和GCC 4.4.3 BEWARE: binaries are using old ABI
選項 RECOMMENDED
一個gccversion_re => qr/^4\\.(4\\.[5-9]|[5-9]\\.[0-9])$/
該文件還有一個sub check_prebuilt_binaries
,該sub check_prebuilt_binaries
遍歷數組,並嘗試將找到的Perl環境與這些條件匹配。
該子程序的第二行已注釋掉要檢查的環境的debug printf(GCC除外)。 我對它進行了注釋,然后向上移動並擴展到包含GCC。
sub check_prebuilt_binaries
{
print "(os=$^O cc=$cc archname=$Config{archname} gccVer=$Config{gccversion})\r\n";
print "checking for prebuilt binaries... ";
my @good = ();
foreach my $b (@{$prebuilt_binaries}) {
if ( ($^O =~ $b->{os_re}) &&
($Config{archname} =~ $b->{arch_re}) &&
($cc =~ $b->{cc_re}) &&
(!defined $b->{gccversion_re} || $Config{gccversion} =~ $b->{gccversion_re})
) {
$b->{buildtype} = 'use_prebuilt_binaries';
push @good, $b;
}
}
scalar(@good)
? print "yes, " . scalar(@good) . " option(s)\n"
: print "no\n";
#returning ARRAY of HASHREFs (sometimes more than one value)
return \@good;
}
然后我運行Perl Build,這是我得到的:
d:\Strawberry\cpan\build\Alien-SDL-1.446-0>perl ./Build.PL
Welcome to Alien::SDL module installation
-----------------------------------------
checking operating system... MSWin32
checking for gcc... yes
checking build system type... MSWin32-x64-multi-thread
checking platform specific module... using 'My::Builder::Windows'
checking SDL_INST_DIR env var... no
checking for config script... no
(os=MSWin32 cc=gcc archname=MSWin32-x64-multi-thread gccVer=8.3.0)
checking for prebuilt binaries... no
You have the following options:
[1] Quit installation
What way do you wanna go? [1 ]1
我不是很好的regexper,但是我可以看到GCC Win64版本固定為4.4.5+或4.5.x-不允許使用5.0+版本。 上一次提交Alien:SDL
時,它們可能不存在。
GCC發行說明經常提到x86-64的ABI更改,例如:
等等
我不知道哪些特定的Win64 GCC ABI更改對於LibSDL至關重要。 但是從CPAN測試看來,至少WinCC ABI在GCC 4.5和7.1之間的變化還不錯。 無論如何,從源頭上用現代GCC編譯SDL 1.x絕對超出我的能力。 所以,接受它還是離開它...
希望一切順利,我剛剛刪除(注釋)了“推薦的” Win64 SDL1預制二進制文件的GCC版本測試。
d:\Strawberry\cpan\build\Alien-SDL-1.446-0>perl ./Build.PL test
Welcome to Alien::SDL module installation
-----------------------------------------
checking operating system... MSWin32
checking for gcc... yes
checking build system type... MSWin32-x64-multi-thread
checking platform specific module... using 'My::Builder::Windows'
Too early to specify a build action 'test'. Do 'Build test' instead.
d:\Strawberry\cpan\build\Alien-SDL-1.446-0>perl ./Build test
Fetching 'http://strawberryperl.com/package/kmx/sdl/Win64_SDL-1.2.14-extended-bin_20111205.zip'...
Checking checksum for 'download\Win64_SDL-1.2.14-extended-bin_20111205.zip'...
Extracting download\Win64_SDL-1.2.14-extended-bin_20111205.zip...
t\001_load.t ................ 1/1 # Testing Alien::SDL 1.446, Perl 5.030000, D:\Strawberry\perl\bin\perl.exe
# Build type: use_prebuilt_binaries
# Detected sdl-config script: n.a.
# Build option used:
# Binaries Win/64bit SDL-1.2.14 (extended, 20111205) RECOMMENDED
# (gfx, image, mixer, net, smpeg, ttf, sound, svg, rtf, Pango)
# URL:
# http://strawberryperl.com/package/kmx/sdl/Win64_SDL-1.2.14-extended-bin_20111205.zip
# http://froggs.de/libsdl/Win64_SDL-1.2.14-extended-bin_20111205.zip
# SHA1: 35f3b496ca443a9d14eff77e9e26acfa813afafd
t\001_load.t ................ ok
t\002_config.t .............. 1/6 # Prefix='D:\Strawberry\cpan\build\Alien-SDL-1.446-0\blib\lib\auto\share\dist\Alien-SDL\1.446_6ae293a9\bin\..\'
t\002_config.t .............. ok
t\003_check_header.t ........ # Testing basic headers SDL.h + SDL_version.h
[Alien::SDL] Testing header(s): SDL.h
t\003_check_header.t ........ 1/2 L.h, SDL_version.h
t\003_check_header.t ........ ok
t\004_get_header_version.t .. 1/1 # Core version: 1.2.14
t\004_get_header_version.t .. ok
t\release-pod-coverage.t .... skipped: these tests are for release candidate testing
t\release-pod-syntax.t ...... skipped: these tests are for release candidate testing
All tests successful.
Files=6, Tests=10, 8 wallclock secs ( 0.06 usr + 0.05 sys = 0.11 CPU)
Result: PASS
雅虎 作品!!! 或似乎。。。
現在,我終於可以使用CPAN來安裝lib和游戲了?
……不幸的是,沒有。
CPAN可能檢測到我修改了源代碼(校驗和失敗),將香草庫重新提取到新的d:\\Strawberry\\cpan\\build\\Alien-SDL-1.446-1\\
文件夾中,並且構建失敗並出現與上述相同的錯誤。 不好。
至少perl ./Build.PL install
有效,但是盡管該庫是本地安裝的,卻幾乎沒有在本地CPAN注冊表中注冊,因為是在CPAN框架之外安裝的。
CPAN專家可能會設法固定偽造CPAN校驗和的本地版本,或者只是將更新的SDL模塊上載到CPAN,但是……我不是。
cpan> install Games::FrozenBubble
Running install for module 'Games::FrozenBubble'
Checksum for D:\Strawberry\cpan\sources\authors\id\K\KT\KTHAKORE\Games-FrozenBubble-2.212.tar.gz ok
......
Running make test for DRTECH/Locale-Maketext-Lexicon-1.00.tar.gz
"D:\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/1-basic.t ...................... 1/33 "msgunfmt" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
t/1-basic.t ...................... ok
……
t/55-runextract.t ................ ok
t/6-gettext.t .................... 1/30 "msgunfmt" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
t/6-gettext.t .................... ok
…...
t/preload.t ...................... ok
t/release-eol.t .................. skipped: these tests are for release candidate testing
t/release-pod-syntax.t ........... skipped: these tests are for release candidate testing
All tests successful.
Files=17, Tests=361, 11 wallclock secs ( 0.22 usr + 0.17 sys = 0.39 CPU)
Result: PASS
通過??? 真?
還有更多補丁-盡管可以運行。 懷舊... https://github.com/kthakore/frozen-bubble/issues/72
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.