admin管理员组

文章数量:1397134

I'm trying to build a solution from a mono-repo (I don't believe the mono-repo structure should matter). One of the projects produces errors due to mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '1' in Error.obj Every project, including the libraries, uses the same build task in MSVC Debug.

The projects' VS configurations are being generated by cli tools.

Output

163>leveldb.lib(repair.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '1' in Error.obj
163>leveldb.lib(table_builder.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '1' in Error.obj
....

163>..\..\bin\five\debug\citizen-resources-client.dll : fatal error LNK1319: 34 mismatches detected

This doesn't happen for anyone else using the repo. The solution successfully builds with a fresh VM. The solution successfully builds with a fresh User. I re-installed MS VS and the required build tools. I checked all 192 projects in the solution for the definitions, and they use the same debug definition.

I'm trying to build a solution from a mono-repo (I don't believe the mono-repo structure should matter). One of the projects produces errors due to mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '1' in Error.obj Every project, including the libraries, uses the same build task in MSVC Debug.

The projects' VS configurations are being generated by cli tools.

Output

163>leveldb.lib(repair.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '1' in Error.obj
163>leveldb.lib(table_builder.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '1' in Error.obj
....

163>..\..\bin\five\debug\citizen-resources-client.dll : fatal error LNK1319: 34 mismatches detected

This doesn't happen for anyone else using the repo. The solution successfully builds with a fresh VM. The solution successfully builds with a fresh User. I re-installed MS VS and the required build tools. I checked all 192 projects in the solution for the definitions, and they use the same debug definition.

Share Improve this question edited Apr 3 at 18:42 The Gamerzs asked Mar 26 at 13:26 The GamerzsThe Gamerzs 235 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 0

I managed to fix the errors by deleting the following files in %localappdata%\vcpkg:

vcpkg.user.props
vcpkg.user.targets

It seems MSVS was allowing vcpkg to import custom properties with the following

  <Import Condition="Exists('C:\Scripts\vcpkg\scripts\buildsystems\msbuild\vcpkg.targets') and '$(VCPkgLocalAppDataDisabled)' == ''" Project="C:\Scripts\vcpkg\scripts\buildsystems\msbuild\vcpkg.targets" />

本文标签: visual cWhy does MSVC build with different definitions in the same build taskStack Overflow