9

I am having problem installing gflags. If I use apt-get as written in (https://github.com/gflags/gflags/blob/master/INSTALL.md) I get the following error

sudo apt-get install gflags
Reading package lists... Done
Building dependency tree        
Reading state information... Done
E: Unable to locate package gflags

How can I install gflags?

ekhan
  • 231
  • 1
  • 4
  • 11

1 Answers1

13

On Ubuntu or Debian machine You can get related packages doing something like this:

$ apt-cache search gflags

Output on my machine (Ubuntu 14.04):

libgflags-dev - commandline flags module for C++ (development files)

libgflags-doc - documentation of gflags

libgflags2 - commandline flags module for C++ (shared library)

python-gflags - Python implementation of the Google command line flags module

python-google-apputils - Google Application Utilities for Python

So, I presume You could install it using it's full name like this:

$ sudo apt-get install libgflags2 libgflags-dev
Community
  • 1
  • 1
Kamiccolo
  • 7,758
  • 3
  • 34
  • 47
  • Thanks. Do I need to add compilation flag when I am compiling a gflag program? – ekhan Jun 04 '15 at 20:25
  • Using make, CMake, ... or compiling something "by hand"? In general, yes. At least for linkage step. – Kamiccolo Jun 04 '15 at 21:26
  • At least for Ubuntu 16.04, all that is needed is `$ sudo apt-get install libgflags-dev` as this also will pull in the `libgflags2` dependency automatically. – phoenix Mar 30 '17 at 20:40