隨筆-124  評(píng)論-194  文章-0  trackbacks-0

          曾試過(guò)用VS2005編譯各種版本openssl都會(huì)到最后用perl測(cè)試說(shuō)LOADDLL失敗,不得其解,可是用下面的方法即可安裝成功,考慮是不是人家是用VC6編譯的:

          更新于08年11月7日:

          下面的PPM用不了了,參看這個(gè):http://theoryx5.uwinnipeg.ca/ppms/

          C:\Documents and Settings\Administrator>ppm install http://theoryx5.uwinnipeg.ca/ppms/Net_SSLeay.pm.ppd


          或者


          add this repository to your list (perl 5.8):
          ppm> rep add RKOBES
          http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58
          then search:
          ppm> search SSLeay
          Searching in Active Repositories
           1. Crypt-SSLeay [0.51] OpenSSL glue that provides LWP https support
           2. Crypt-SSLeay [0.51]
           3. Net_SSLeay.pm [1.25] Perl extension for using OpenSSL
          ppm>install Net_SSLeay.pm

          在解壓目錄下,運(yùn)行perl test.pl可以成功。

          這是在perlorg上問(wèn)的貼,可以參考:

          http://perlchina.sun126.com/cgi-bin/ccb/topic_view.cgi?forum=4&article_id=0004061125003921&publishtime_id=0004061125003921&page=40


          更新于2008年1月6日:
          最近,又再次試圖自己安裝OPENSSL+SSLeay,用了SSLeay里README.WIN32說(shuō)的方法:

          3. Windows XP SP2 CAUTION: this is not working yet
             ActivePerl 5.8.8.820
             Visual Studio Express 2005
             Microsoft Platform SDK SVR2003R2
             OpenSSL 0.9.8e source openssl-0.9.8e.tar.gz
             Dynamic linking to SSL DLLs

          - Install all packages in the order listed above (make sure you follow the
             instructions on the download page about adding the appropriate paths to the
             Projects and Solutions section of the Options dialog box, and updating
             corewin_express.vsprops file)
          - Start a build shell with Start->All Programs->Microsoft Windows SDK->CMD Shell
          - cd openssl-0.9.8e
          - perl Configure VC-WIN32 --prefix=c:/OpenSSL
          - ms\do_masm
          - nmake -f ms\ntdll.mak
          - nmake -f ms\ntdll.mak install
             (if you have trouble getting to this stage, consult INSTALL.W32)
          - cd Net-SSLeay-xxxx
          - perl Makefile.PL
          - nmake
          - copy c:\OpenSSL\bin\*.dll blib\arch\auto\Net\SSLeay\
          - nmake test
            CAUTION: nmake test fails at this stage. Any suggestions?? This may be
             relevant: http://www.itwriting.com/blog/?postid=261&replyto=2542
          - nmake install


          應(yīng)該說(shuō)基本成功了,這次也最后同樣遇到了LOADDLL失敗,好像是R2604錯(cuò)誤,這是引用msvcr80.dll出的問(wèn)題,順著方法里提到的URL看一下這里,介紹了微軟為了解決DLL HELL問(wèn)題引入了SIDE BY SIDE的DLL存在方式,我把我看了這篇文章的理解說(shuō)明如下:
          微軟現(xiàn)在使用MANIFEST資源文件注入到DLL中的方法來(lái)解決DLL的依賴(lài)問(wèn)題,在這個(gè)文件中以XML方式說(shuō)明了本DLL將會(huì)引用到的其它系統(tǒng)DLL的詳盡版本,這個(gè)文件由鏈接器自動(dòng)生成。其機(jī)關(guān)在此:
          可以到C:\WINDOWS\WinSxS看一下,這里共存了相同名字不同版本的DLL。
          特別是POLICIES目錄中MSVCR80目錄中相關(guān)XML有一句:
          <bindingRedirect oldVersion="8.0.41204.256-8.0.50608.0" newVersion="8.0.50727.762"/>
          這就是說(shuō)凡是有DLL中引用了之前老版本都會(huì)被重定位到最新版本。

          VC2005編譯出來(lái)的SSLeay.dll引用的是8.0.50608.0的,我們要把鏈接器產(chǎn)生的MANIFEST文件注入到DLL中:

          mt /manifest SSLeay.dll.manifest /outputresource:SSLeay.dll;#2

          這樣至少可以通過(guò)NETSSLEAY的自測(cè)了。


          但是,凡事都有個(gè)但是,真FAINT,當(dāng)我用IO::Socket::SSL包時(shí),報(bào)找不到randomize函數(shù),是不是因?yàn)镾SLeay太新了的緣故,此事還無(wú)解。所以為了用這個(gè)包,還是用前述的PPM方式安裝會(huì)比較好,那個(gè)方法我已經(jīng)驗(yàn)證過(guò),裝和用都沒(méi)問(wèn)題。

          posted on 2006-11-26 11:35 我愛(ài)佳娃 閱讀(2324) 評(píng)論(0)  編輯  收藏 所屬分類(lèi): Perl
          主站蜘蛛池模板: 嘉义市| 泉州市| 莒南县| 彩票| 张掖市| 河间市| 雷州市| 山西省| 全椒县| 台山市| 南岸区| 涿鹿县| 金平| 怀安县| 交口县| 扎赉特旗| 邓州市| 临沂市| 桐乡市| 桃园县| 洱源县| 常宁市| 远安县| 土默特右旗| 龙陵县| 内乡县| 通辽市| 邢台县| 九龙县| 新巴尔虎左旗| 永济市| 临清市| 芦溪县| 泾源县| 徐水县| 崇义县| 岳阳县| 云浮市| 金川县| 临潭县| 青海省|