-
Notifications
You must be signed in to change notification settings - Fork 923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set propper runtime library for use in msvc project #1079
Comments
@Chrys4lisfag thanks for reporting. I'm not a Windows dev working with msvc so my knowledge here is limited. This can be taken as starting point. |
Yeah, I've got no issues with cmake project. The only issue when I've build cpr as static library and tried to link it to my msvc project. It had crt linking type mismatch between cpr.lib and my msvc project, so I had to modify cpr library CmakeLists by adding "set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$CONFIG:Debug:Debug>")" this line to make it work. |
@Chrys4lisfag How did you add this I am facing the same issue. I am using cmake fetch content to include cpr in my project. Where did you include |
I've added this directly in the cpr`s CMakeLists then built cpr library as static (-DBUILD_SHARED_LIBS=OFF) and used output .lib and includes in my project |
Closing this one as there seams no action required from the cpr side here. |
Description
Tried to build as static library for use in msvc project and got runtime mismatch with my library and cpr.
cpr had /md while I needed /mt
Example/How to Reproduce
Possible Fix
Adding this resolved the issue
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$CONFIG:Debug:Debug>")
Where did you get it from?
GitHub (branch e.g. master)
Additional Context/Your Environment
I am new to cmake but as I understand this must be accounted on your side
The text was updated successfully, but these errors were encountered: