fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC sha

hi, all.

Recently i build a MFC project. It works fine.

After I add a cu file to this project. Appears the error:

[codebox]fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d][/codebox]

I have set the values following( Debug/Win32 ):

Configuration Properties > General :

 Use of MFC : Use MFC in a Shared DLL

Configuration Properties > C/C++ > Code Generation :

 Runtime Library : /MDd

Configuration Properties > CUDA Build Rule v2.3.0 > Hybrid CUDA/C++ :

 Runtime Library : /MDd

I don’t know what is the error mean, please help me.

So strange.

When I delete the line: #include “stdafx.h” in the cu files, it can be compiled.

But this project was coded a few weeks ago and the compiler required the header file.

AFAIK CUDA stuff (like cudart.dll) was built with /MT (/MTd for debug versions). There’s a runtime library mismatch.