在github 下载:https://github.com/gflags/gflags
用cmake 安装:按照如下步骤就行了 ccmake后修改build中的CMakeCache.txt:
改为CMAKE_CXX_FLAGS:STRING=-fPIC
再执行就可以
export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1
make && make install
$ tar xzf gflags-$version-source.tar.gz
$ cd gflags-$version
$ mkdir build && cd build
$ ccmake ..
- Press 'c' to configure the build system and 'e' to ignore warnings.
- Set CMAKE_INSTALL_PREFIX and other CMake variables and options.
- Continue pressing 'c' until the option 'g' is available.
- Then press 'g' to generate the configuration files for GNU Make.
$ make
$ make test (optional)
$ make install (optional)