[BUG]: Error compiling with Google Benchmark
See original GitHub issueDescribe 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:
- Created a year ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
right, sorry, i forgot about our caching, i’ll fix it
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()
andmax()
and clang uses gcc’s stdlib by default