Visual Studio project settings
Some basic Visual Studio project settings may be different from the defaults created by the Visual Studio Project Wizard. Ensure that you set up your project’s build settings to produce apps and DLLs that are compatible with Windows PE, as follows:
-
You must develop Windows PE apps with native C or C++ code that does not use MFC or ATL. Therefore, if you use the Visual Studio Project Wizard, choose a Win32 project and make sure that neither MFC nor ATL are checked.
-
Set your project options to link to the static C/C++ runtime libraries, not the .dll version of Msvcrt.dll.
-
Open your project properties and set Configuration Properties \ C/C++ RunTime Library to Multi-threaded or Multi-threaded debug, not one of the .dll versions. If you do not perform this step, your app might not run on Windows PE.
-
If you plan to host your app on the 64-bit version of Windows PE, set the project build options to compile all binaries with the x64 compiler in Visual Studio.
-
If you plan to host your app on the 32-bit version of Windows PE, set the project options to compile with the x86 compiler.
-
Ensure that your project does not have the /clr: compiler option set. This option produces managed C++ code, which will not run on Windows PE.
Warning Your app can use customized .dll files that you write or license from a third party. Add these .dll files to your app for Windows PE. However, do not use Msvcrt.dll and do not include additional Windows .dll files that are not part of Windows PE.

本文详细介绍了在Visual Studio中为Windows PE平台开发应用程序时所需的基本项目设置,包括选择合适的项目类型、链接静态C/C++运行库、设置编译器选项以避免使用CLR,以及针对目标平台(32位或64位)进行编译。
1万+

被折叠的 条评论
为什么被折叠?



