An error occurred when compiling the program in VS 2013:
Error message 1:
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]
The conventional one is: use MFC in the static library, or use the standard Windows library, at this time, no matter what it is, an error may be reported.
The multi-threaded debugging in the runtime library is: MDd (multi-threaded debugging DLL)
Change MDd to MTd. If error 2 is reported after correction, change it as follows.
Error message 2:
error C1189: #error: Please use the /MD switch for _AFXDLL builds
The conventional one is: use MFC in a shared DLL,
The multi-threaded debugging in the runtime library is: MTd (multi-threaded debugging)
Change the general to: use MFC in the static library, or use the standard Windows library
Conventional and runtime libraries are as follows:
General: Right-click the project -> Properties -> Configuration Properties -> General, and then select “Use MFC in a static library” in the “Use of MFC” option in the “Project Defaults” on the right,
Multi-threaded debugging: Right-click the project–>Properties->Configuration Properties->c/c++->Code Generation->Runtime Library->Multithreaded Debugging (/MTd)
There are three settings for the use of MFC :
1. Use standard Windows libraries
2. Use MFC in the static library: it is to write the relevant code in the DLL into the EXE file, the file is larger, but it can be run on the machine without the relevant DLL;
3. Use MFC in a shared DLL: It means that the content of some MFC DLLs is not included in the EXE file when packaging, so the EXE file is small, but the system requires related DLL files at runtime;
/MD: Use multithreading in the dll to create the release version of the dynamic link library, which needs to be selected.
/MT: Use multithreading in exe to create a release version of exe, which needs to be selected.
/MTd: Same as /MT, but used in the Debug version.
/MDL: Same as /MD, but used in the Debug version.
If it is Debug’s “Use MFC in a static library”, don’t use MDd, use MTd instead, and then compile it to pass.
If it is Debug’s “Use MFC in shared DLL”, be careful not to use MTd, use MDd instead;
If it is the Release version “use MFC in static library”, don’t use MD, use MT;
If it is the Release version of “Use MFC in a shared DLL”, do not use MT, use MD.
- Error lnk2038: detected “_ ITERATOR_ DEBUG_ Mismatched ‘level’ value of ‘0’
- error while loading shared libraries: lib*.so: cannot open shared object file: No such file or directory
- [error record] Android application release package error handling (turn off syntax check log processing release configuration)
- JSP error: The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path
- [Solved] error: Failed dependencies libcrypto.so.10()(64bit) is needed, libssl.so.10()(64bit) is needed
- [Solved] The method getContextPath() from the type HttpServletRequest refers to the missing type String
- The showdialog() method in thread/threading. Timer/task reported an error: “before ole can be called, the current thread must be set to single thread unit (STA) mode.”
- [Solved] error LNK2038: Detected mismatch of “RuntimeLibrary”: The value “MDd_DynamicDebug” does not match the value “MTd_StaticDebug”
- Error 2 error c2491: XX: definition of dllimport static data member is not allowed
- Eclipse Tomcat Error creating bean with name ‘sqlSessionFactory’ defined in URL…
- [Samtools] Run error: error while loading shared libraries: libcrypto.so.1.0.0 or libncurses.so.5 or libtinfow.so.5
- Error. Onload failed when ‘rjava’ was calculated in loadnamespace()
- Visual Studio 2012 error C4996: ‘scanf’: This function or variable may be unsafe.
- Solution for Visual Studio 2012 compilation error [error C4996:’scanf’: This function or variable may be unsafe.]
- How to Solve Gradle Error: Plugin with id ‘jetty’ not found.
- Error while trying to run project:unable to start debugging.the debugger is not properly installed. run setup to install or repa
- [Solved] IDEA Error: java: Compilation failed: internal java compiler error
- The SDK of Android webrtc compiled with Ninja – C out / release command reported an error, and the Android NDK processing method could not be found
- Clion new method shows undefined reference to solution
- How to Solve Error: “initializer element is not constant”