Update build instructions for Visual Studio (#1980)
diff --git a/docs/platform_specific_build_instructions.md b/docs/platform_specific_build_instructions.md index 2d5d6c4..5c1439d 100644 --- a/docs/platform_specific_build_instructions.md +++ b/docs/platform_specific_build_instructions.md
@@ -15,22 +15,26 @@ [`pthread_create()`](https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.lib_ref/topic/p/pthread_create.html)). There's no separate pthread library to link. -## Building with Visual Studio 2015 or 2017 +## Building with Visual Studio 2015, 2017 or 2022 The `shlwapi` library (`-lshlwapi`) is required to support a call to `CPUInfo` which reads the registry. Either add `shlwapi.lib` under `[ Configuration Properties > Linker > Input ]`, or use the following: ``` // Alternatively, can add libraries using linker options. + +// First, Add the path to the generated library files (directory containing the `benchmark.lib`) in `[Configuration Properties > Linker > General > Additional Library Directories]`. Then do the following: #ifdef _WIN32 #pragma comment ( lib, "Shlwapi.lib" ) #ifdef _DEBUG -#pragma comment ( lib, "benchmarkd.lib" ) +#pragma comment ( lib, "benchmark.lib" ) #else #pragma comment ( lib, "benchmark.lib" ) #endif #endif ``` +When using the static library, make sure to add `BENCHMARK_STATIC_DEFINE` under `[Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions]` + Can also use the graphical version of CMake: * Open `CMake GUI`. * Under `Where to build the binaries`, same path as source plus `build`.