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

          曾試過用VS2005編譯各種版本openssl都會(huì)到最后用perl測(cè)試說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上問的貼,可以參考:

          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說的方法:

          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)該說基本成功了,這次也最后同樣遇到了LOADDLL失敗,好像是R2604錯(cuò)誤,這是引用msvcr80.dll出的問題,順著方法里提到的URL看一下這里,介紹了微軟為了解決DLL HELL問題引入了SIDE BY SIDE的DLL存在方式,我把我看了這篇文章的理解說明如下:
          微軟現(xiàn)在使用MANIFEST資源文件注入到DLL中的方法來解決DLL的依賴問題,在這個(gè)文件中以XML方式說明了本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"/>
          這就是說凡是有DLL中引用了之前老版本都會(huì)被重定位到最新版本。

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

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

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


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

          posted on 2006-11-26 11:35 我愛佳娃 閱讀(2328) 評(píng)論(0)  編輯  收藏 所屬分類: Perl
          主站蜘蛛池模板: 宜都市| 西宁市| 库车县| 布尔津县| 临武县| 永丰县| 西乌珠穆沁旗| 肇源县| 达拉特旗| 体育| 林芝县| 太原市| 阿克苏市| 凤城市| 东乡族自治县| 四川省| 藁城市| 聂拉木县| 漠河县| 七台河市| 潮安县| 新源县| 斗六市| 怀来县| 磐安县| 汶川县| 屯昌县| 大足县| 宜都市| 平和县| 上虞市| 怀远县| 长治县| 疏勒县| 广宁县| 滨海县| 和硕县| 海南省| 托克托县| 玉溪市| 阿鲁科尔沁旗|