相关疑难解决方法(0)

静态断言因“Windows 标头需要默认打包选项...”而失败

当我尝试在 Visual Studio 中编译我的 C++ 项目时,我不断收到以下 2 个错误:

E1574: Static assertion failed with "Windows headers require the default 
packing option. Changing this can lead to memory corruption. This diagnostic 
can be disabled by building with WINDOWS_IGNORE_PACKING_MISMATCH defined."
Run Code Online (Sandbox Code Playgroud)

C2338: Windows headers require the default packing option. Changing this can 
lead to memory corruption. This diagnostic can be disabled by building with 
WINDOWS_IGNORE_PACKING_MISMATCH defined.
Run Code Online (Sandbox Code Playgroud)

我认为问题必须出在我的 Visual Studio 设置中,导致该项目在我的另一台 PC 上编译得很好,而我刚刚在这台 PC 上安装了 Visual Studio。

从进行一些搜索来看,问题似乎源于 Windows 软件包不匹配,但是在安装 Visual Studio 时,我尝试安装我看到的所有 C++ …

c++ windows header-files visual-studio

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

c++ ×1

header-files ×1

visual-studio ×1

windows ×1