Link 2005 error

xiaoxiao2021-03-06  18

Under VC 2003, if a static library is used, it is very likely that the connection error of the link 2005 is due to the CRT library, the CRT library uses weak external links to New, Delete and DLLMain functions, if we change the library The connection order can solve this error

solution

There are two ways to solve this problem: the first solution involves the forced linker link library in the correct order. The second solution is to let you find modules that cause problems and correct it.

Solution 1: Forced Links Link Library in the Clear Sequence

1. On the Generate menu, click Settings. 2. In the Project Settings dialog box, click the items view of the item, click to select a project configuration that appears link errors. 3. On the Links tab, click "INPUT" in the Category combo box. 4. In "To ignore the library", insert the library name (for example, Nafxcwd.lib; libcmtd.lib). Note: Equivalent linker command line is: / NOD: . 5. In the Object / Library Module box, insert the library name. Must ensure that these libraries are listed in order and are listed as the first two libraries in the command line (for example, NAFXCWD.LIB and LIBCMTD.LIB). To set this option in Visual C .NET, read the "Set Visual C Project Properties" online help topic.

Solution 2: Find and correct the module that appears to see the current library link order, follow these steps:

1. On the Generate menu, click Settings. 2. In the Project Settings dialog box, click the items view of the item, click to select a project configuration that appears link errors. 3. On the Links tab, type / verbose: lib in the Project Options box. 4. Regenerate the project. These libraries will be listed in the output window during the link.

转载请注明原文地址:https://www.9cbs.com/read-45418.html

New Post(0)