大家好,又见面了,我是全栈君。
1 没有安装MySQL所需要的boost库
测试发现编译MySQL5.7以及更高的版本时,都需要下载并引用或者直接安装boost库,否则在执行cmake
命令时会报如下错误:
-- Running cmake version 3.2.1
-- Configuring with MAX_INDEXES = 64U
-- SIZEOF_VOIDP 8
-- MySQL 5.7.6-m16 [MySQL版本]
-- Packaging as: mysql-5.7.6-m16-Linux-x86_64
-- Looked for boost/version.hpp in and
-- BOOST_INCLUDE_DIR BOOST_INCLUDE_DIR-NOTFOUND
-- LOCAL_BOOST_DIR
-- LOCAL_BOOST_ZIP
-- Could not find (the correct version of) boost. [关键错误信息]
-- MySQL currently requires boost_1_57_0 [解决办法]
CMake Error at cmake/boost.cmake:76 (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:228 (COULD_NOT_FIND_BOOST)
CMakeLists.txt:452 (INCLUDE)
-- Configuring incomplete, errors occurred!
See also "/mydata/mysql-5.7.6-m16/CMakeFiles/CMakeOutput.log".
解决方法:先下载Boost库,然后通过在cmake命令后面添加参数-DDOWNLOAD_BOOST=1 -DWITH_BOOST=Boost库路径
即可。
mkdir /usr/local/boost
cd /usr/local/boost
wget http://www.sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz
tar zxvf boost_1_59_0.tar.gz
注意:如果在CMAKE的过程中有报错,当报错解决后,需要把源码目录中的CMakeCache.txt文件删除,然后再重新Cmake
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/111702.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...