Enabling Address Sanitizer results in error LNK2038: mismatch detected for 'annotate_vector': value '0' doesn't match value '1'
Mark Hastings
36
Reputation points
Never had this problem with ASAN in VS 2019, but with the current latest VS 2022 17.2.2 release I have enabled ASAN for all my C++ projects and encounter this linker error when linking in other "prebuilt" C++ libraries that were not compiled with -fsanitize=address, such as boost:
libboost_thread-vc143-mt-x64-1_79.lib(thread.obj) : error LNK2038: mismatch detected for 'annotate_vector': value '0' doesn't match value '1' in ApplicationInfo.obj
Creating library C:\source\Windows\x64\Release\XYZ.lib and object C:\source\Windows\x64\Release\XYZ.exp
C:\source\Windows\x64\Release\XYZ.dll : fatal error LNK1319: 1 mismatches detected
Done building project "XYZ.vcxproj" -- FAILED.
Is there some new requirement that all code must be built with ASAN enabled? That would severely limit its usefulness.
Developer technologies | C++
3,977 questions
Sign in to answer