Error LNK2026 building with Visual Studio

Last updated on

Problem

Building a Visual Studio project that links a Dinkey Pro API library fails with "error LNK2026: module unsafe for SAFESEH image".

Solution

Dinkey Pro runtime code is incompatible with the SAFESEH feature. Turn off SAFESEH by opening your project properties, going to Linker > Advanced and setting Image Has Safe Exception Handlers to No.

If you really need to link with an object file that has SAFESEH enabled (for example you want to meet a Microsoft standard) then please contact Microcosm and we can generate a SAFESEH-compatible library for you.