benchmark icon indicating copy to clipboard operation
benchmark copied to clipboard

Building on Windows with VS2017 and BUILD_SHARED_LIBS=ON doesn't create .lib files

Open KyleFromKitware opened this issue 7 years ago • 2 comments

When I configure on Windows with:

cmake .. -GNinja -DBUILD_SHARED_LIBS=ON

and build, no .lib file is generated for the .dlls. Furthermore, running dumpbin on one of the .dlls:

dumpbin /exports src\benchmark.dll

confirms that no symbols are exported in the .dll. I suspect they are not given the proper __declspec(dllexport) directive.

KyleFromKitware avatar Oct 10 '19 18:10 KyleFromKitware

@KyleFromKitware can you share the steps of building on windows with Visual 2017?

ura1286 avatar Oct 14 '19 06:10 ura1286

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"
cmake .. -GNinja -DBUILD_SHARED_LIBS=ON -DBENCHMARK_ENABLE_GTEST_TESTS=OFF
ninja

I disabled tests so I wouldn't have to deal with building GTest.

KyleFromKitware avatar Oct 14 '19 14:10 KyleFromKitware