編譯mcrypt出錯,mhash怎麼都對不上(已解決)

來源:互聯網
上載者:User
想自己編譯安裝php的mcrypt擴充

# libmcrypttar zxf libmcrypt-2.5.8.tar.gzcd libmcrypt-2.5.8./configure --prefix=/home/felix021/lamp/libmcrypt/makemake install# mhashtar jxf mhash-0.9.9.9.tar.bz2cd mhash-0.9.9.9./configure --prefix=/home/felix021/lamp/mhash/makemake install# mcryptLD_LIBRARY_PATH=/home/felix021/lamp/libmcrypt/lib:/home/felix021/lamp/mhash/lib./configure --prefix=/home/felix021/lamp/mcrypt/ --with-libmcrypt-prefix=/home/felix021/lamp/libmcrypt

configure不通過,提示:

checking for mhash_keygen in -lmhash... no
configure: error: "You need at least libmhash 0.8.15 to compile this program. http://mhash.sf.net/"

於是專門去找了mhash0.8.18和mhash0.8.15,依然是這個錯誤。

查了一下mhash_keygen這個函數,在0.8.15/8中是
int mhash_keygen(xxx,xxx,xxx)
在 0.9.9.9 中是

#if defined(PROTOTYPES)mutils_error mhash_keygen(keygenid algorithm, ....)#elsemutils_error mhash_keygen();#endif

(mutils_error是typedef的uint32)

而mcrypt的configure裡頭12114行用來測試的是

char mhash_keygen ();

即使把char改成 mutils_error 也還是不行。

求解。

回複內容:

想自己編譯安裝php的mcrypt擴充

# libmcrypttar zxf libmcrypt-2.5.8.tar.gzcd libmcrypt-2.5.8./configure --prefix=/home/felix021/lamp/libmcrypt/makemake install# mhashtar jxf mhash-0.9.9.9.tar.bz2cd mhash-0.9.9.9./configure --prefix=/home/felix021/lamp/mhash/makemake install# mcryptLD_LIBRARY_PATH=/home/felix021/lamp/libmcrypt/lib:/home/felix021/lamp/mhash/lib./configure --prefix=/home/felix021/lamp/mcrypt/ --with-libmcrypt-prefix=/home/felix021/lamp/libmcrypt

configure不通過,提示:

checking for mhash_keygen in -lmhash... no
configure: error: "You need at least libmhash 0.8.15 to compile this program. http://mhash.sf.net/"

於是專門去找了mhash0.8.18和mhash0.8.15,依然是這個錯誤。

查了一下mhash_keygen這個函數,在0.8.15/8中是
int mhash_keygen(xxx,xxx,xxx)
在 0.9.9.9 中是

#if defined(PROTOTYPES)mutils_error mhash_keygen(keygenid algorithm, ....)#elsemutils_error mhash_keygen();#endif

(mutils_error是typedef的uint32)

而mcrypt的configure裡頭12114行用來測試的是

char mhash_keygen ();

即使把char改成 mutils_error 也還是不行。

求解。

問題解決了,StackOverflow上面的大牛指出,在編譯mcrypt之前需要在LDFLAGS中給出-L和-I

export LD_LIBRARY_PATH=/home/felix021/lamp/libmcrypt/lib:/home/felix021/lamp/mhash/libexport LDFLAGS="-L/home/felix021/lamp/mhash/lib/ -I/home/felix021/lamp/mhash/include/"export CFLAGS="-I/home/felix021/lamp/mhash/include/"./configure --prefix=/home/felix021/lamp/mcrypt/ --with-libmcrypt-prefix=/home/felix021/lamp/libmcrypt

參見 http://stackoverflow.com/questions/63...

你新安裝了動態連結程式庫,在mcrypt configure之前執行一下ldconfig試試

直接用yum吧,直接編譯源碼的話,會有很多庫的依賴,在configure的時候並沒有處理好

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.