This error is familiar to people who often write C++, so I looked for this error. There are several general solutions on the Internet:
disable incremental linking
Project Properties -> Configuration Properties -> Linker (General) -> Enable Incremental Linking -> “No (/INCREMENTAL:NO)”
turning off “Embed Manifest”
This is used in the project settings of the vs solution. But I am using CMake now, what’s the matter? Keep looking. . . Finally, I found the answer on Stackoverflow:
It turned out that I had two versions of this utility in my path.
One at C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cvtres.exe
and one at C:\Windows\Microsoft.NET\Framework\v4.0.30319\cvtres.exe. After VS2012 install, the VS2010 version of cvtres.exe will no longer work. If that's the first one in your path, and the linker decides it needs to convert a .res file to COFF object format, the link will fail with LNK1123. (Really annoying that the error message has nothing to do with the actual problem, but that's not unusual for a Microsoft product.) Just delete/rename the older version of the utility, or re-arrange your PATH variable, so that the version that works comes first.
In other words, there are two cvtres.exe in the system, located in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cvtres.exe and C:\Windows\Microsoft.NET\Framework\v4. 0.30319\cvtres.exe. If you use the program under the first path, there will be problems (don’t know the specific reason, is it a bug in vs2010?), if you use the second path, there is no problem. Therefore, the simplest solution is to delete or rename the cvtres under the first path, and let CMake directly use the cvtres under the second path.
Similar Posts:
- The C compiler identification is unknown No CMAKE_C_COMPILER could be found
- [Solved] Windows SDK Fails to Install with Return Code 5100
- Installation tutorial of visual studio 2017 and visual Assist X
- Visual Studio Failed to Start Error: throw error ‘cannot run when setup is in progress’
- Microsoft report viewer 2012 cannot load related DLL
- error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = ‘v100’) cannot be found
- pyinstaller WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency
- Error link: fatal error lnk1158: unable to run ‘RC. Exe’
- error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools”:
- [Solved] Visual Studio 2015 Warning: Cannot find one or more components. Please reinstall the application.