diff --git a/README.md b/README.md index 06d80939..5318f7a6 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ IRC channel: https://freenode.net #googlebenchmark Define a function that executes the code to be measured. ```c++ +#include + static void BM_StringCreation(benchmark::State& state) { while (state.KeepRunning()) std::string empty_string; @@ -36,6 +38,8 @@ BENCHMARK(BM_StringCopy); BENCHMARK_MAIN(); ``` +Don't forget to inform your linker to add benchmark library e.g. through `-lbenchmark` compilation flag. + ### Passing arguments Sometimes a family of benchmarks can be implemented with just one routine that takes an extra argument to specify which one of the family of benchmarks to