[BUG] Confusing title in docs/platform_specific_build_instructions.md
Los mantenedores suelen responder en 1 día
@skryabae ya está trabajando en esto.
Desde el 8/10/2026.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 88/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- cmake, cpp
- Área
- documentation
Línea de trabajo
Abre docs/platform_specific_build_instructions.md y lee la sección titulada "Building with Visual Studio 2015, 2017 or 2022" junto con el contexto de build de Windows indicado. Actualiza la documentación para que el encabezado y el texto dejen claro que las instrucciones también se aplican a mingw-w64-ucrt-x86_64 y, después, verifica que la sección renderizada ya no resulte engañosa.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
In the file https://github.com/google/benchmark/blob/main/docs/platform_specific_build_instructions.md, there is a section titled "Building with Visual Studio 2015, 2017 or 2022". The instructions are not specific to Visual Studio, and the heading is therefore misleading.
I am working on Windows 11 25H2 and using the mingw-w64-ucrt-x86_64-toolchain for compilation and linking: gcc 16.1.0, ld 2.46; and ninja 1.13.2 for the build.
I built the library using the tools mentioned above and then tried to run the code from the "Usage" section of the README, linking against the static library build/src/libbenchmark.a.
The code snippet:
#include <benchmark/benchmark.h>
static void BM_StringCreation(benchmark::State& state) {
for (auto _ : state)
std::string empty_string;
}
// Register the function as a benchmark
BENCHMARK(BM_StringCreation);
// Define another benchmark
static void BM_StringCopy(benchmark::State& state) {
std::string x = "hello";
for (auto _ : state)
std::string copy(x);
}
BENCHMARK(BM_StringCopy);
BENCHMARK_MAIN();
Compilation:
D:\Projects\cpptest>c++ main.cpp -isystem "D:/Projects/benchmark/include" -L"D:/Projects/benchmark/build/src" -lbenchmark -lpthread -o main.exe
D:/Programm/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\egor\AppData\Local\Temp\cctoO03V.o:main.cpp:(.text+0x66): undefined reference to `__imp__ZN9benchmark5State16StartKeepRunningEv'
D:/Programm/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\egor\AppData\Local\Temp\cctoO03V.o:main.cpp:(.text+0xed): undefined reference to `__imp__ZN9benchmark5State17FinishKeepRunningEv'
D:/Programm/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\egor\AppData\Local\Temp\cctoO03V.o:main.cpp:(.text+0x198): undefined reference to `__imp__ZN9benchmark5State16StartKeepRunningEv'
D:/Programm/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\egor\AppData\Local\Temp\cctoO03V.o:main.cpp:(.text+0x229): undefined reference to `__imp__ZN9benchmark5State17FinishKeepRunningEv'
D:/Programm/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\egor\AppData\Local\Temp\cctoO03V.o:main.cpp:(.text+0x28f): undefined reference to `__imp__ZN9benchmark23MaybeReenterWithoutASLREiPPc'
D:/Programm/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\egor\AppData\Local\Temp\cctoO03V.o:main.cpp:(.text+0x2ca): undefined reference to `__imp__ZN9benchmark16PrintDefaultHelpEv'
D:/Programm/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\egor\AppData\Local\Temp\cctoO03V.o:main.cpp:(.text+0x2df): undefined reference to `__imp__ZN9benchmark10InitializeEPiPPcPFvvE'
D:/Programm/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\egor\AppData\Local\Temp\cctoO03V.o:main.cpp:(.text+0x2f1): undefined reference to `__imp__ZN9benchmark27ReportUnrecognizedArgumentsEiPPc'
D:/Programm/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\egor\AppData\Local\Temp\cctoO03V.o:main.cpp:(.text+0x305): undefined reference to `__imp__ZN9benchmark22RunSpecifiedBenchmarksEv'
D:/Programm/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\egor\AppData\Local\Temp\cctoO03V.o:main.cpp:(.text+0x30e): undefined reference to `__imp__ZN9benchmark8ShutdownEv'
D:/Programm/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\egor\AppData\Local\Temp\cctoO03V.o:main.cpp:(.text+0x32d): undefined reference to `__imp__ZN9benchmark8internal17InitializeStreamsEv'
D:/Programm/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\egor\AppData\Local\Temp\cctoO03V.o:main.cpp:(.text+0x378): undefined reference to `__imp__ZN9benchmark8internal25RegisterBenchmarkInternalESt10unique_ptrINS_9BenchmarkESt14default_deleteIS2_EE'
D:/Programm/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\egor\AppData\Local\Temp\cctoO03V.o:main.cpp:(.text+0x3dc): undefined reference to `__imp__ZN9benchmark8internal25RegisterBenchmarkInternalESt10unique_ptrINS_9BenchmarkESt14default_deleteIS2_EE'
D:/Programm/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\egor\AppData\Local\Temp\cctoO03V.o:main.cpp:(.text$_ZN9benchmark8internal17FunctionBenchmarkC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPFvRNS_5StateEE[_ZN9benchmark8internal17FunctionBenchmarkC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPFvRNS_5StateEE]+0x22): undefined reference to `__imp__ZN9benchmark9BenchmarkC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'
D:/Programm/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\egor\AppData\Local\Temp\cctoO03V.o:main.cpp:(.text$_ZN9benchmark8internal17FunctionBenchmarkC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPFvRNS_5StateEE[_ZN9benchmark8internal17FunctionBenchmarkC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPFvRNS_5StateEE]+0x2b): undefined reference to `__imp__ZTVN9benchmark8internal17FunctionBenchmarkE'
collect2.exe: error: ld returned 1 exit status
I was able to fix the error using the solution described in this Stack Overflow post: https://stackoverflow.com/questions/78600881/undefined-references-when-linking-google-benchmark-with-g-on-windows-msys2-u?newreg=d8053eb47e674ea6a805c335e7e46134
I spent a relatively large amount of time troubleshooting this issue because the section heading in https://github.com/google/benchmark/blob/main/docs/platform_specific_build_instructions.md#building-with-visual-studio-2015-2017-or-2022 is misleading and suggests that the instructions are only relevant to Visual Studio.
I think it would be worth mentioning that these instructions are also applicable to mingw-w64-ucrt-x86_64.
System
Which OS, compiler, and compiler version are you using:
- OS: Windows 11 25H2
- Compiler and version: gcc 16.1.0, ld 2.46
To reproduce
Steps to reproduce the behavior:
- git clone https://github.com/google/benchmark.git && cd benchmark
- do README Installation instruction with -G Ninja when generating the build system with cmake
- create file with code snippet from README Basic usage section and try to compile it with command proposed in the same section below/
Expected behavior
Successful compilation and linkage
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
- Lenguaje dominante
- C++
- Estrellas
- 10.5k
- Forks
- 1.8k
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 28
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de google/benchmark
-
[BUG] Memory manager counts allocations not part of benchmarkQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
google/benchmark#2149 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
[FR] Add native Zig bindings via top-level `bindings/zig`Quizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 42/100
google/benchmark#2266 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
google/benchmark#2235 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
google/benchmark#2195 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
[BUG] Minimum benchmark time with multiple threadsPosiblemente ocupada @hahnjo la tomó hace 282 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
google/benchmark#2117 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de google/benchmark
Issues similares
-
status:needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
PX4/PX4-Autopilot#29698 ·
Los mantenedores suelen responder en 1 día
-
go perft exits when EvalFile is unavailablePosiblemente ocupada @Muawiya-contact la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
official-stockfish/Stockfish#7292 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
arvidn/libtorrent#9149 ·
Los mantenedores suelen responder en 1 día
-
Upstream report: MSVC rejects a designated initializer in a dependent template argument (C2131)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
rhalbersma/tabula#72 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
esp8266/Arduino#9342 · 2 comentarios ·
Los mantenedores suelen responder en 1 día