MSVC debug suffix
Closed this issue · 4 comments
jalegido commented
When I use network-uri in my application with -DUri_USE_STATIC_CRT=OFF, compiler shows errors when linking in debug mode.
To solve, I have to create different network-uri.lib for release and debug mode.
I have to modify src/CMakeLists.txt to specify the debug_postfix when MSVC is detected.
if (MSVC)
#When compiling with MSVC we use different names for release and debug library.
#We solve problems when linking in debug mode
set(CMAKE_DEBUG_POSTFIX d)
endif()
add_library(network-uri ${Uri_SRCS})
jalegido commented
I can add -DCMAKE_DEBUG_POSTFIX=d to my cmake command. So it is not necesary to add it explicitly in the CMakeLists.txt.
What do you think? Is better add it to the command line?
glynos commented
I think this should be easy to fix in the CMakeLists.txt file.
glynos commented
I have decided against applying this fix in the CMakeLists.txt file, I think the workaround using the command line argument that you suggested should be enough.