Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++14 is required for the example #1943

Open
jun-shibata opened this issue Mar 8, 2025 · 0 comments
Open

C++14 is required for the example #1943

jun-shibata opened this issue Mar 8, 2025 · 0 comments

Comments

@jun-shibata
Copy link

It's a small thing, but the compile option -std=c++11 in this example should be updated.

https://github.com/google/benchmark?tab=readme-ov-file#basic-usage

The error occurs because make_unique is used.

benchmark/include/benchmark/benchmark.h:1371:12: error: 'make_unique' is not a member of 'std'
 1371 |       std::make_unique<internal::FunctionBenchmark>(name, fn));

Please fix the compilation command.

# Example on linux after running the build steps above. Assumes the
# `benchmark` and `build` directories are under the current directory.
- $ g++ mybenchmark.cc -std=c++11 -isystem benchmark/include \
+ $ g++ mybenchmark.cc -std=c++14 -isystem benchmark/include \
  -Lbenchmark/build/src -lbenchmark -lpthread -o mybenchmark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants