Page 1 of 1

Error trying to build with ASAN on Windows

Posted: Mon Jun 30, 2025 10:25 pm
by jwwalker

I'm trying to build OgreNextMain on Windows with Address Sanitizer turned on, in Visual Studio Community 2022, but I get a slew of link errors like this:

Code: Select all

1>FreeImage_d.lib(Plugin.obj) : error LNK2038: mismatch detected for 'annotate_string': value '0' doesn't match value '1' in OgreAbiUtils.obj
1>FreeImage_d.lib(Plugin.obj) : error LNK2038: mismatch detected for 'annotate_vector': value '0' doesn't match value '1' in OgreAbiUtils.obj
1>FreeImage_d.lib(FreeImage.obj) : error LNK2038: mismatch detected for 'annotate_string': value '0' doesn't match value '1' in OgreAbiUtils.obj
1>FreeImage_d.lib(FreeImage.obj) : error LNK2038: mismatch detected for 'annotate_vector': value '0' doesn't match value '1' in OgreAbiUtils.obj

I pulled the latest changes from the ogre-next-deps repository and rebuilt, but that didn't help. What do these errors mean?


Re: Error trying to build with ASAN on Windows

Posted: Tue Jul 01, 2025 3:54 am
by dark_sylinc

It's been a while since I've tried ASAN on Windows.
Are you enabling ASAN via CMake option OGRE_ADDRESS_SANITIZER_ASAN or by manually modifying the VS Project?

The error you see indicates there's a setting disagreement in how ogre-next-deps was compiled vs ogre-next.
It may get fixed if ogre-next-deps is also forced to be compiled with ASAN.


Re: Error trying to build with ASAN on Windows

Posted: Tue Jul 01, 2025 5:18 pm
by jwwalker

I turned on ASAN in the VS project. You are correct, turning on ASAN for FreeImage (not all of ogre-next-deps) make the link succeed! Thanks.