When the C Run-Time (CRT) library and Microsoft Foundation Class (MFC) libraries are linked in the w

来源:互联网 发布:雷洋 知乎 编辑:程序博客网 时间:2024/05/17 16:02
 

Solution One: Force Linker to Link Libraries in Correct Order

  1. On the Project menu, click Settings.
  2. In the Settings For view of the Project Settings dialog box, click to select the project configuration that is getting the link errors.
  3. On the Link tab, click to select Input in the Category combo box.
  4. In the Ignore libraries box, insert the library names (for example, Nafxcwd.lib;Libcmtd.lib).

    Note The linker command-line equivalent in /NOD:<library name>.
  5. In the Object/library modules box, insert the library names. You must make sure that these are listed in order and as the first two libraries in the line (for example, Nafxcwd.lib Libcmtd.lib).
To set this option in Visual C++ .NET, read the "Setting Visual C++ Project Properties" online help topic.

Solution Two: Locate and Correct the Problem Module

To view the current library link order, follow these steps:
  1. On the Project menu, click Settings.
  2. In the Settings For view of the Project Settings dialog box, click to select the project configuration that is getting the link errors.
  3. On the Link tab, type /verbose:lib in the Project Options box.
  4. Rebuild your project. The libraries will be listed in the output window during the linking process.
原创粉丝点击