A collection of useful C++ libraries.
sudo apt install cmake g++ gcc libgflags-dev 7za-full
7za-full
is used for handling gzip compression file IO.
Then clone the repository into directory $ENV{GIT_REPO}/cpplib
. Here
GIT_REPO
is an environment variable (e.g., defined in .zshenv
).
git clone --recursive https://github.com/zzjjzzgggg/cpplib.git
mkdir build
cd build
cmake ..
make
This requires another repository cmake
.
git clone https://github.com/zzjjzzgggg/cmake.git
Then add following line in your project CMakeLists.txt
.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} $ENV{GIT_REPO}/cmake)
Set environment variable CPPLIB_DIR
in .zshenv
or other place, e.g.,
export CPPLIB_DIR=$HOME/git_project/cpplib
In your Makefile, add follows
IDIR=-I$(CPPLIB_DIR) -I/usr/include/gflags
LIBS=-L$(CPPLIB_DIR)/lib -losutils -lioutils -lstrutils -lgflags
test: test.cpp
g++ $(IDIR) $(LIBS) -Wall -o $@ $<