A LNK2005 error occurs when the CRT library and MFC libraries are linked in the wrong order in Visual C++
2011-02-23 09:11
686 查看
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q148652 写的挺正确的。
下面的实际解决方法之一。
在编译一个opensource代码的时候,发现其在 stdafx.h文件的最前面包含了其他代码,导致如下问题出现
#pragma once
#include "../../../DSUtil/SharedInclude.h"
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#define ResStr(id) CString(MAKEINTRESOURCE(id))
#include <afxdisp.h>
#include <afxole.h>
#include <streams.h>
#include <dvdmedia.h>
#include <mpconfig.h>
#ifndef _WIN64
#include <qt/qt.h>
#endif
#include "../../../DSUtil/DSUtil.h"
修改方式为:将#include "../../../DSUtil/SharedInclude.h" 放到后面,这样lib库的加载顺序会变为先加载mfc库。 OK
下面的实际解决方法之一。
在编译一个opensource代码的时候,发现其在 stdafx.h文件的最前面包含了其他代码,导致如下问题出现
#pragma once
#include "../../../DSUtil/SharedInclude.h"
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#define ResStr(id) CString(MAKEINTRESOURCE(id))
#include <afxdisp.h>
#include <afxole.h>
#include <streams.h>
#include <dvdmedia.h>
#include <mpconfig.h>
#ifndef _WIN64
#include <qt/qt.h>
#endif
#include "../../../DSUtil/DSUtil.h"
修改方式为:将#include "../../../DSUtil/SharedInclude.h" 放到后面,这样lib库的加载顺序会变为先加载mfc库。 OK
相关文章推荐
- A LNK2005 error occurs when the CRT library and MFC libraries are linked in the wrong order in Visual C++
- zz : A LNK2005 error occurs when the CRT library and MFC libraries are linked in the wrong order in Visual C++ ---- nafxcw.lib(a
- A LNK2005 error occurs when the CRT library and MFC libraries are linked in the wrong order in Visua
- How to solve problem caused when the CRT library and MFC libraries are linked in the wrong order
- When the C Run-Time (CRT) library and Microsoft Foundation Class (MFC) libraries are linked in the w
- When install ”matplotlib” with ”pip”, if you get the following error, it means the “freetype” and “png” libraries needed by matplotlib are not installed:
- You receive a C4226 or a C4236 error message when you compile code to contain the keyword in 32-bit Visual C++(ZZ)
- How to invoke the method of managed bean and render view in JSF when we are outside the lifecycle of JSF
- How to use the System Restore API to save and to restore system data in Visual C++
- Typically this problem occurs when you are putting in a data that is too long for the column. In t
- #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. Th
- What are the differences between struct and class in C++?
- c++ what happens when a constructor throws an exception and leaves the object in an inconsistent state?
- Automating Excel 2007 and creating charts using C++ MFC application in Visual Studio 2008
- Description of the default C and C++ libraries that a program will link with when built by using Vis
- Windows API, CRT, and the Standard C++ Library
- New features in Visual C++ 10 and MFC 10
- #error This file requires compiler and library support for the ISO C++ 2011错误解决办法
- 《Description of CWnd derived MFC objects and multithreaded applications in Visual C++》译文
- FW:Use the OnReadyStateChange Property in Visual Basic and Visual C/C++