KhronosGroup / SPIRV-Cross

SPIRV-Cross is a practical tool and library for performing reflection on SPIR-V and disassembling SPIR-V back to high level languages.
Apache License 2.0
1.96k stars 549 forks source link

Obj): error LNK2038: Mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' mismatch value 'MDd_DynamicDebug' (in Car.obj) #2341

Open RIKDXHQ11 opened 2 weeks ago

RIKDXHQ11 commented 2 weeks ago

Obj): error LNK2038: Mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' mismatch value 'MDd_DynamicDebug' (in Car.obj)

In the process of using these DLLs, I found that: \Lib \ shaderc_shared.lib \Lib \ spirv cross core lib \Lib \ spirv cross glsl.lib and \Lib \ shaderc_sharedd.lib \Lib \ spirv cross cored.lib \Lib \ spirv cross glsld.lib They are all the same, they are all MD-DynamicRelease I want to use the debug version of the DLL because they can be used together with other debug commands.

HansKristian-Work commented 1 week ago

This looks like a typical MSVC bug if you load a CMake project directly in the IDE instead of generating an msbuild. Try adding this to your CMakeLists.txt before calling project(). I've had success with that before. I don't think this is an SPIRV-Cross per-se.

if (POLICY CMP0091)
    cmake_policy(SET CMP0091 NEW)
endif()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")