A collection of high-quality, free, and open-source libraries that extend the functionality of the C++ programming language; Dawes et al. (1998).
npm install boost.cxxbash
$ npm i boost.cxx
`
And then include boost/thread.hpp as follows:
`cxx
// main.cxx
#include
int main() { / ... / }
`
Finally, compile while adding the path node_modules/boost.cxx to your compiler's include paths.
`bash
$ clang++ -std=c++17 -I./node_modules/boost.cxx main.cxx # or, use g++
$ g++ -std=c++17 -I./node_modules/boost.cxx main.cxx
`
You may also use a simpler approach with the cpoach tool, which automatically adds the necessary include paths of all the installed dependencies for your project.
`bash
$ cpoach clang++ -std=c++17 main.cxx # or, use g++
$ cpoach g++ -std=c++17 main.cxx
``