问题
I am using visual studio 2015 on windows 10. I want to compile a windows 7 compatible binary file. But there is no windows 7 option in the project properties. When I put the binary on windows 7, it told me "The procedure entry point CreateEventExA could not located in the dynamic link library api-ms-win-core-synch-l1-2-0.dll"
回答1:
You need to install Visual C++ Redistributable for Visual Studio 2015 on the target machine. Here is the link: https://www.microsoft.com/en-us/download/details.aspx?id=48145
回答2:
The previous answer addressed the Microsoft Visual C++ Redistributable
(v140 of mscvrt) but this isn't enough to get your binary working on Windows that hasn't been updated to the Universal CRT (Windows 8.1 SP1 and up).
For more information:http://blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx
In a nutshell, copy all the DLLs from
C:\Program Files (x86)\Windows Kits\10\Redist\ucrt
to the target machine.
-OR-
You can install Visual Studio 2012 and use its toolset which will enable your program to link against msvcrt110.dll and run out of the box on Windows 7.
Set The toolset by right clicking your project -> properties -> General -> Platfrom Toolset -> Visual Studio 2012 (v110)
来源:https://stackoverflow.com/questions/32792402/how-to-compile-a-windows-7-compatible-binary-on-visusal-studio-2015