MySQL5.7源碼編譯——報錯 CMake Error at cmake/boost.cmake:81 (MESSAGE)

-- Running cmake version 3.10.0
...... 中間省略
-- BOOST_VERSION_NUMBER is #define BOOST_VERSION 106501
CMake Warning at cmake/boost.cmake:266 (MESSAGE):
  **Boost minor version found is 65 we need 59** //**此爲關鍵問題**
Call Stack (most recent call first):
  CMakeLists.txt:491 (INCLUDE)

-- BOOST_INCLUDE_DIR D:/develop/7.lang/boost_1_65_1
-- LOCAL_BOOST_DIR D:/develop/7.lang/boost_1_65_1
-- LOCAL_BOOST_ZIP LOCAL_BOOST_ZIP-NOTFOUND
-- Could not find (the correct version of) boost.
-- MySQL currently requires boost_1_59_0

CMake Error at cmake/boost.cmake:81 (MESSAGE):
  You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory>

  This CMake script will look for boost in <directory>.  If it is not there,
  it will download and unpack it (in that directory) for you.

  If you are inside a firewall, you may need to use an http proxy:

  export http_proxy=http://example.com:80

Call Stack (most recent call first):
  cmake/boost.cmake:269 (COULD_NOT_FIND_BOOST)
  CMakeLists.txt:491 (INCLUDE)


-- Configuring incomplete, errors occurred!

從錯誤日誌來看,應該是boost的版本不對,MySQL5.7源碼編譯需要的boost_1_59_0,當前安裝的版本是1_65_1。然後再看下源碼確認下,打開{源碼包目錄}/cmake/boost.cmake,定位到269行。

IF(NOT BOOST_MINOR_VERSION EQUAL 59)
  MESSAGE(WARNING "Boost minor version found is ${BOOST_MINOR_VERSION} "
    "we need 59"
    )
  COULD_NOT_FIND_BOOST() //此處爲錯誤日誌打出來的地方
ENDIF()

應該就是版本問題,下載boost_1_59_0重新編譯下試試。

另外一篇博客會完整記錄下編譯過程。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章