src/logging_unittest.cc:64:17: error: ‘GFLAGS_NAMESPACE’ is not a namespace-name using namespace GFLAGS_NAMESPACE; ^ src/logging_unittest.cc:64:33: error: expected namespace-name before ‘;’ token using namespace GFLAGS_NAMESPACE; ^ src/logging_unittest.cc: In function ‘int main(int, char**)’: src/logging_unittest.cc:180:43: error: ‘ParseCommandLineFlags’ was not declared in this scope ParseCommandLineFlags(&argc, &argv, true); src/logging_unittest.cc:180:43: note: suggested alternative: In file included from src/glog/logging.h:86:0, from src/utilities.h:82, from src/logging_unittest.cc:33: /usr/include/gflags/gflags.h:346:31: note: ‘gflags::ParseCommandLineFlags’ extern GFLAGS_DLL_DECL uint32 ParseCommandLineFlags(int *argc, char*** argv, bool remove_flags);
# 卸载系统的gflags sudo yum remove -y gflags-devel # 下载编译gflags cd ~ wget -O gflags-2.2.1.tar.gz https://github.com/gflags/gflags/archive/v2.2.1.tar.gz tar zxvf gflags-2.2.1.tar.gz cd gflags-2.2.1 mkdir -p build && cd build cmake .. -DCMAKE_INSTALL_PREFIX=`pwd`/../../gflags make make install cd ~/glog-0.3.5 ./configure --prefix=`pwd`/../glog --includedir=~/gflags/include make make install