安装C++所需的环境:
yum install -y gcc gcc-c++ make automake
安装wget工具:
yum install -y wget
下载CMake工具:
wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz
解压CMake:
进入对应的目录,查看目录结构:
进入目录后,进行安装操作,步骤如下:
cd cmake-2.8.10.2
./bootstrap
gmake
gmake install
下载log4cpp
官网log4cpp下载 或者git下载git clone https://git.code.sf.net/p/log4cpp/codegit log4cpp-codegit
编译安装
-
cd log4cpp-codegit/
-
./autogen.sh
-
./configure
-
make
-
make check
-
make install
安装完成后,头文件在/usr/local/include/log4cpp, 库文件在/usr/local/lib下