You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
I have download and compile and test Google BenchMark success on My Linux, My Mac. but On My Windows PC , I get an error when other project link the benchmark!
I know this is because the benchmark project is a lib generated by MD, but the test project regards it as MT, so the link is wrong.
I am forced to manually modify the benchmark attribute to MT then build and then manually copy it to the installation directory . it can work well.
I have tried the code below adding to CMakeLists.txt, it don't work!
if (MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT")
endif
or adding MT to the build script, but it has no effect! cmake -E chdir "build" cmake -DCMAKE_CXX_FLAGS_RELEASE=/MT -DCMAKE_CXX_FLAGS=/MT -DBENCHMARK_DOWNLOAD_DEPENDENCIES=on -DCMAKE_BUILD_TYPE=Release ../
System
Which OS, compiler, and compiler version are you using:
OS: windows 11,22H2,22621.2134
Compiler and version: Microsoft Visual Studio Professional 2022 (64-bit) - Current
Version 17.6.5
To reproduce
Steps to reproduce the behavior:
install.bat
Describe the bug
A clear and concise description of what the bug is.
I have download and compile and test Google BenchMark success on My Linux, My Mac. but On My Windows PC , I get an error when other project link the benchmark!
I know this is because the benchmark project is a lib generated by MD, but the test project regards it as MT, so the link is wrong.
I am forced to manually modify the benchmark attribute to MT then build and then manually copy it to the installation directory . it can work well.
I have tried the code below adding to CMakeLists.txt, it don't work!
or adding MT to the build script, but it has no effect!
cmake -E chdir "build" cmake -DCMAKE_CXX_FLAGS_RELEASE=/MT -DCMAKE_CXX_FLAGS=/MT -DBENCHMARK_DOWNLOAD_DEPENDENCIES=on -DCMAKE_BUILD_TYPE=Release ../
System
Which OS, compiler, and compiler version are you using:
Version 17.6.5
To reproduce
Steps to reproduce the behavior:
install.bat
then other project use the google bench
CMakeLists.txt
Expected behavior
A clear and concise description of what you expected to happen.
How Can fix the google benchmark MD to MT auto
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: