c++ - 使用 VS2012 编译 libffi 失败并出现 fatal error LNK1281 : Unable to generate SAFESEH image

标签 c++ visual-studio visual-c++ visual-studio-2012 libffi

使用 VS11 编译 libffi 会出现以下链接器错误

libffi\libffi-3.0.9\ms\Win32\Debug\ffi.dll : fatal error LNK1281: Unable to generate SAFESEH image.

同一项目在 VS10 上编译正常,但在 VS2012 自动升级后,它开始出现链接器错误

MSDN中的解释太隐晦而且帮助不大

我可能会用 /SAFESEH:NO 重建,但我不确定其中的含义。

请告知可能出现的问题。

最佳答案

没有 SAFESEH 的主要含义是您的应用程序不会被 Windows 8 商店或 Windows 8 desktop certification 接受。 .如果这对您来说不是问题,请随意使用 /SAFESEH:NO

documentation说:

The most common reason for the linker not to be able to produce an image is because one or more of the input files (modules) to the linker was not compatible with the safe exception handlers feature. A common reason for a module to not be compatible with safe exception handlers is because it was created with a compiler from a previous version of Visual C++.

有没有可能是项目升级到VS2012把设置改成了/SAFESEH:YES。也许您从未使用过 SAFESEH 进行构建。

关于c++ - 使用 VS2012 编译 libffi 失败并出现 fatal error LNK1281 : Unable to generate SAFESEH image,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14630069/

相关文章:

C++ 用余弦插值数组

c++ - 带状态栏的对话框

c++ - g++4.8 对 gdb 隐藏变量

visual-studio - Microsoft SQL Server Management Studio 启动后立即关闭

c++ - MSVC预编译头: Which files need to #include "stdafx.h"?

c++ - 如何将 QTreeWidget 中的列调整到所需的最小空间

visual-studio - Visual Studio : missing Shortcut: "Visual Studio Command Prompt"

c# - 为什么在 Visual Studio 2012 中禁用复选框 'Prefer 32-bit'?

visual-studio - 如何用 Visual C++ 编写一个简单的 GUI 应用程序

c++ - 如何制作一个可以处理 .txt 文件而不显示它的 C++ 程序