Tag Archives: VS Compilation errors

[Solved] VS Compilation errors: #error: Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll ver…

error

The following error occurred while compiling the file with vs:

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

Checked on the Internet, most of the solutions ignore some details, so they may not solve the problem. Here are some details

solutions

1. Select “solution manager” first, and then change “multi thread debugging DLL (/ MDD)” to “multi thread debugging DLL (/ MT)” or “multi thread debugging (/ MTD)” according to the following path: Project – properties – C/C + + – code generation – runtime

2. Select “solution manager”, and then follow the following path: Project – properties – configuration properties – General – Project default – use of MFC, and select “use MFC in shared DLL” (sometimes it does not need to be modified)

3. From the error prompt: “please define”_ Afxdll or do not use/MD [D] “, we can also define” define “_ Afxdll “to solve the problem

precautions

1. Note that selecting “property manager” and “Solution Explorer” will get different property pages. The former is to modify the properties of the whole vs system, while the latter only affects the current project

2. What is provided here are only three points that should be modified to solve this error. If the above solution is completely followed, sometimes it can not solve the problem. The correct idea is to randomly combine the options mentioned in the first two methods and recompile them to try to find out if there is any error. This is the easiest way. After all, everyone is configured in a different environment