question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG]: Error compiling with Google Benchmark

See original GitHub issue

Describe the bug

Compiler gives error

/opt/compiler-explorer/gcc-12.2.0/bin/../lib/gcc/x86_64-linux-gnu/12.2.0/../../../../x86_64-linux-gnu/bin/ld: cannot find -lbenchmark: No such file or directory

when I select Google Benchmark 1.4.1 or 1.5.0 from libraries. Also if I select Google Benchmark 1.6.2 it gives other error

/opt/compiler-explorer/libs/google-benchmark/v1.6.2/include/benchmark/benchmark.h:190:10: fatal error: benchmark/export.h: No such file or directory 190 | #include "benchmark/export.h" | ^~~~~~~~~~~~~~~~~~~~

Steps to reproduce

Visit link for version 1.4.1 and 1.5.0 and link for version 1.6.2.

I used GCC 12.2 but same error happens for Clang 15.

Expected behavior

Google Benchmark library should work and be linkable.

Reproduction link

https://godbolt.org/z/eaYz7fj4f

https://godbolt.org/z/KMP8ncTbv

Screenshots

Not applicable

Operating System

Windows 10

Browser version

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
partoufcommented, Oct 29, 2022

right, sorry, i forgot about our caching, i’ll fix it

1reaction
partoufcommented, Oct 29, 2022

It works with libc++ if that’s any consolation https://godbolt.org/z/jqcxWdYW5

It’s just that GCC changed some internals and that broke certain things like min() and max() and clang uses gcc’s stdlib by default

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] clang-11 compile error #1083 - google/benchmark
Describe the bug Cannot compile benchmark due to a configuration error during the cmake phase. System Which OS, compiler, and compiler ...
Read more >
UnexpectedBuildFailure at BenchmarkPluginTest.kt:75 [170832555 ...
The build https://android-build.googleplex.com/builds/submitted/6903513/androidx_host_tests/latest/view/logs/build_error.log. failed with this error:
Read more >
Benchmark - Android Developers
This plugin sets build configuration defaults for the module, sets up benchmark output copy to the host, and provides the ./gradlew lockClocks task....
Read more >
CPU2017 benchmark 510.parest_r build failed with gcc9.3 ...
All the benchmark build successed, except 510.parest_r. Then i try build it with gcc9.4, meet the same error. I used the Example-gcc-linux- ...
Read more >
764647 – dev-cpp/benchmark: build failure on gcc-11
Bug 764647 - dev-cpp/benchmark: build failure on gcc-11 ... Fixed upstream as: https://github.com/google/benchmark/commit/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found