Skip to content

C++14 is required for the example #1943

@jun-shibata

Description

@jun-shibata

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions