Unexplainable error “Please use the /MD switch for _AFXDLL builds”
问题 I use VisualStudio2010 and CMake 2.8.12.1. I created a CMakeLists.txt for a MFC project. MFC capability was done by following lines in the CMake file: add_definitions(-D_AFXDLL) #enables MFC set(CMAKE_MFC_FLAG 2) #use shared MFC library Furthermore the project will be build with MD as runtime library (default). But now I want my project to be build as MT (which also requires to specify static MFC library). So I replaced the lines above with: add_definitions(-D_AFXDLL) #enables MFC set(CMAKE