Repository navigation
|
I downloaded the precompiled Meshlib library Release v3.1.3.429, but when I tried to compile in Debug, I got the following error: _ITERATOR_DEBUG_LEVEL is inconsistent with MeshLib. development environment: VS 2022 |
Replies: 1 comment 1 reply
|
This is not a broken package — it is a deliberate Why it happensA Visual Studio Debug configuration defines // source/MRMesh/MRMeshFwd.h
#if !defined MR_ITERATOR_DEBUG_LEVEL
#define MR_ITERATOR_DEBUG_LEVEL 0
#endif
#if _ITERATOR_DEBUG_LEVEL != MR_ITERATOR_DEBUG_LEVEL
#error _ITERATOR_DEBUG_LEVEL is inconsistent with MeshLib
#endif
Option A — keep
|
This is not a broken package — it is a deliberate
#errorin MeshLib, and it is telling you that your application and the pre-built binaries disagree about_ITERATOR_DEBUG_LEVEL.Why it happens
A Visual Studio Debug configuration defines
_DEBUG, and the Microsoft STL then implies_ITERATOR_DEBUG_LEVEL=2. Non-zero iterator debugging makes MS STL containers dramatically slower, so allMeshLibDistVS*binaries are built with_ITERATOR_DEBUG_LEVEL=0— that includeslib/Debugandapp/Debug, which are otherwise genuine debug builds (unoptimized, with PDBs). Mixing the two values in one process changes the layout of every STL container (sizeof(std::vector<int>)is 24 vs 32,sizeof(std::string)32 …