Link a DLL with nvrtc_static.lib and nvrtc-builtins_static.lib

Hi,

I try to link my DLL that manages different kernels statically with nvrtc_static.lib nvrtc-builtins_static.lib. If I link with nvrtc.lib I do not get any errors. If I link with the static version I run into several problems:

for the release version I get tons of this message:

nvrtc_static.lib(nvrtctmp82.obj) : error LNK2038: mismatch detected for ‘RuntimeLibrary’: value ‘MT_StaticRelease’ doesn’t match value ‘MD_DynamicRelease’ in KM_DllInterface.obj

for the debug version I get these message:

1> nvrtc_static.lib(nvrtctmp82.obj) : error LNK2038: mismatch detected for ‘_ITERATOR_DEBUG_LEVEL’: value ‘0’ doesn’t match value ‘2’ in KM_DllInterface.obj
1> nvrtc_static.lib(nvrtctmp82.obj) : error LNK2038: mismatch detected for ‘RuntimeLibrary’: value ‘MT_StaticRelease’ doesn’t match value ‘MDd_DynamicDebug’ in KM_DllInterface.obj

I tried cuda 12.0 and cuda 11.6.2 as well as the msvc and the intel C++ 2022 compiler - all with the same result.

Any idea what I’m doing wrong?

Thanks,
Daniel