Skip to content

Installing Glog on Ubuntu 14.04

Sergiu Deitsch edited this page Nov 12, 2017 · 5 revisions
  1. Download gflags and compile it:
  $ mkdir build && cd build
  $ cmake -DGFLAGS_NAMESPACE=google -DCMAKE_CXX_FLAGS=-fPIC ..
  $ make && sudo make install
  1. If you encounter the error undefined reference to 'google::FlagRegisterer::FlagRegisterer', you need to remove the old gflags installation as follows:
  $ sudo apt-get purge libgflags-dev
  1. If you encounter the error something wrong with flag 'flagfile' in file 'XXX.cc', you are possibly trying to link file XXX.cc both statically and dynamically into the executable. To resolve the problem, you must build a shared version of all libraries. Using CMake this can be done by setting the BUILD_SHARED_LIBS CMake option to ON, and then recompiling both gflags and glog.
  $ cmake -DBUILD_SHARED_LIBS:BOOL=ON <project-dir>
  $ cmake --build <build-dir>
  1. Download glog and compile it:
  $ ./configure
  $ make -j8
  $ sudo make install
Clone this wiki locally