Repair VS2017 LNK1104 error can not open the macro library file errors

1. Problem Description:

Use Visual Studio 2017 to create a default C ++ projects, compile error, suggesting LNK1104: can not open file "MSVCRTD.lib".

img_201922-220728_6.png


2. Analysis:

Compared to other computer programming environment, the project - property - property page -VC ++ directory: library catalog, find the system macros $ (VC_LibraryPath_x86) there is an error, part of the path does not exist. Error path: C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Professional \ VC \ Tools \ MSVC \ 14.16.27023 \ lib \ Spectre \ x86; ... the correct path is: C: \ Program Files ( x86) \ Microsoft Visual Studio \ 2017 \ Professional \ VC \ Tools \ MSVC \ 14.16.27023 \ lib \ x86; ... the wrong path are more than a "Spectre \".

img_201922-223432_11.png.

3. Solution:

You can add the correct path manually, or correction system macros $ (VC_LibraryPath_x86) settings. Highlights how to fix the system macros, often complicated the search after determining is C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Professional \ Common7 \ IDE \ VC \ VCTargets \ Microsoft.Cpp.Common.props file for errors, positioning the row "<VCLibDirMod Condition =" '$ (VCLibDirMod)'! = 'true' and '$ (SpectreMitigation)' == 'Spectre' "> Spectre \ </ VCLibDirMod>", deleting "Spectre \" to . As to why such errors occur is not known.

img_201922-224340_15.png

4. The purpose of this paper:

Most everyone you meet problems are specific, it is impossible to do the same, this article aims to tell the reader If you encounter such errors or need custom macros VS system should be on how to make the system have hundreds of properties .props setting file, using Everything, UltraEdit tools to search for the feature path, file name, target string and the like.

Note that most macros are nested, the screening when there are more difficult, it is recommended to do a backup when you modify verification.

5. Results:

After the macro $ (VC_LibraryPath_x86) content correction, compile successfully.

img_201922-225322_16.png

Guess you like

Origin blog.51cto.com/firswof/2439817