From 8f42cc04d83dd32848a495b3fee969507141bee4 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 21 Feb 2018 14:42:58 +0000 Subject: [PATCH] Update note about linking with pthreads --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6bd81e701c..6dc6616fd0 100644 --- a/README.md +++ b/README.md @@ -893,8 +893,11 @@ If you are using gcc, you might need to set `GCC_AR` and `GCC_RANLIB` cmake cach If you are using clang, you may need to set `LLVMAR_EXECUTABLE`, `LLVMNM_EXECUTABLE` and `LLVMRANLIB_EXECUTABLE` cmake cache variables. ## Linking against the library -When using gcc, it is necessary to link against pthread to avoid runtime exceptions. -This is due to how gcc implements std::thread. + +When the library is built using GCC it is necessary to link with `-pthread`, +due to how GCC implements `std::thread`. + +For GCC 4.x failing to link to pthreads will lead to runtime exceptions, not linker errors. See [issue #67](https://github.com/google/benchmark/issues/67) for more details. ## Compiler Support