静态断言失败,出现"Windows headers require the default packing option..."
Static assertion failed with "Windows headers require the default packing option..."
当我尝试在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."
和
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.
我认为问题一定是我的Visual Studio设置中的某个问题,因为该项目在我的另一台PC上编译良好,并且我刚刚在这台PC上安装了Visual Studio。
从进行一些搜索看起来问题源于Windows软件包的不匹配,但是在安装Visual Studio时,我尝试安装我看到的所有C++和Windows 10模块。
另外,我只包括windows.h
才能使用ShellExecute()
,所以如果有更好的使用方法ShellExecute()
我对此持开放态度。谢谢!
正如上面提到的1201ProgramAlarm,解决方案是禁用/Zp
(结构打包(编译器选项。
相关文章:
- 这对"With a stackless coroutine, only the top-level routine may be suspended."意味着什么
- Doees the 'this' 指针参与虚函数的多态行为
- 为什么我会收到"Run-Time Check Failure #2 - Stack around the variable 'pr' was corrupted"错误?
- 您将如何连接"on the fly"文本+整数并将其传递给函数?
- 如何理解"Temporary objs are destroyed as the last step in evaluating the full-expression"?谁能用一些简单的例子来说明这
- 如何解决C++中声纳库贝静态代码分析错误"Explicitly define the missing copy constructor, move constructor .."
- Configuring the MPEG4MediaSink
- 这在C++ "It does not own the underlying data, and so is cheap to copy or assign"中意味着什么
- What is the std::chrono::time_point equivalent of std::numer
- 如何在数据库程序中添加"reduce the quantity of an item"功能?
- 使用自定义 nodejs 插件时的"The specified module could not be found"
- Boost.Python 和导入 dll,"The specified module could not be found"
- "Build succeeded"但"The breakpoint will not currently be hit"
- 重写require后调用"lua_getfield()"时崩溃
- 使用全局变量与局部变量和require
- 通过require在不同的Lua状态之间共享全局变量
- 尝试应用肖恩父母谈话"inheritance is the base class of evil"中的模式
- 为什么'allocate in one library and free in the other'是错误的
- 如何修复此错误"the value of 'x1' is not usable in a constant expression"?static_assert
- 静态断言失败,出现"Windows headers require the default packing option..."