简体   繁体   中英

LNK2038: mismatch detected for 'RuntimeLibrary' with cuda

I am compiling a dynamic library containing cpp with cu files with Visual Studio 2013, and I get such errors during linking:

proj_generated_cufile.cu.obj : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in file.obj
libcpmt.lib(ios.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in file.obj

I am not using any additional libraries, and I have already tried to set the Runtime Library in the project preferences -> C/C++ -> Code generation to "Multi-Threaded DLL (/MD)" and under CUDA C/C++ -> Host to "Multi-Threaded DLL (/MD)" or to "inherit from host".

I am generating the project with cmake (with cuda_add_library).

Can it be, that the problem is, that I am trying to compile a dynamic library? What contradicts this assumption is that when I am compiling only the cpp files the compilation succeeds.

Thank you for any suggestion!

我认为,一个与CRT DLL(/ MD)相关联,另一个与静态链接(/ MT)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM