-
Notifications
You must be signed in to change notification settings - Fork 2k
Installing Glog on Ubuntu 14.04
Sergiu Deitsch edited this page Nov 12, 2017
·
5 revisions
- Download gflags and compile it:
$ mkdir build && cd build
$ cmake -DGFLAGS_NAMESPACE=google -DCMAKE_CXX_FLAGS=-fPIC ..
$ make && sudo make install
- 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
- If you encounter the error
something wrong with flag 'flagfile' in file 'XXX.cc'
, you are possibly trying to link fileXXX.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 theBUILD_SHARED_LIBS
CMake option toON
, and then recompiling both gflags and glog.
$ cmake -DBUILD_SHARED_LIBS:BOOL=ON <project-dir>
$ cmake --build <build-dir>
- Download glog and compile it:
$ ./configure
$ make -j8
$ sudo make install