Compiling libffi with VS2012 fails with fatal error LNK1281: Unable to generate SAFESEH image

做~自己de王妃 提交于 2020-01-12 14:11:52

问题


Compiling libffi with VS11 gives the following linker error

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

The same project was compiling fine with VS10, but after an auto upgrade with VS2012, it started giving linker error

The Explanation in MSDN is too cryptic and least helpful

I might rebuild with /SAFESEH:NO , but I am unsure of the implication.

Please advise what might go wrong.


回答1:


The main implication of not having SAFESEH is that your application won't be accepted for the Windows 8 store, or for Windows 8 desktop certification. If that's not an issue for you then feel free to use /SAFESEH:NO.

The documentation says:

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++.

Is it possible that the project upgrade to VS2012 changed the setting to /SAFESEH:YES. Perhaps you've never been building with SAFESEH.



来源:https://stackoverflow.com/questions/14630069/compiling-libffi-with-vs2012-fails-with-fatal-error-lnk1281-unable-to-generate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!