C++ External Libraries Cheatsheet

kuniga.me > Docs > C++ External Libraries Cheatsheet

C++ External Libraries Cheatsheet

Folly

Setup

Download

git clone https://github.com/facebook/folly.git

Install dependencies

On MacOS it uses homebrew, no need to use sudo (as the README suggests):

cd folly
./build/fbcode_builder/getdeps.py install-system-deps --recursive

Build

Create a directory inside your home, folly/. Run:

python3 ./build/fbcode_builder/getdeps.py --allow-system-packages build --install-dir /home/me/folly/

Setting paths

On MacOS, add to .bash_profile:

export CPLUS_INCLUDE_PATH=/home/me/folly/include:$CPLUS_INCLUDE_PATH
export LIBRARY_PATH=/home/me/folly/lib:$LIBRARY_PATH

Linking

During compilation:

g++ -std=c++17 main.cpp -lfolly