1

I am compiling a static library (Rive in this case) with iterator debug level of 2, to be compatible with all my other static libs in this project. The toolset is LLVM clang on Windows, targeting x64.

Side note: The Rive project uses a different build system (premake5) than the others I have compiled, which have used cmake.

I am getting an error during compile #error _ITERATOR_DEBUG_LEVEL > 1 is not supported in release mode.. However, from what I can tell, I am NOT compiling in release mode. Why might I be getting the error about "release mode"?

Here is an example compiler command:

clang++   -MMD -MP -D_USE_MATH_DEFINES -DDEBUG -D_ITERATOR_DEBUG_LEVEL=2 -I../include -m64 -g -std=c++17 -Wall -fno-exceptions -fno-rtti -MTd  -o \"obj/debug/cubic_asymmetric_vertex_base.o\" -MF \"obj/debug/cubic_asymmetric_vertex_base.d\" -c \"../src/generated/shapes/cubic_asymmetric_vertex_base.cpp\"",...)

From what I can tell, -g is generating debug symbols and -MTd specifies debug static library. Why is the error telling me I'm in release mode?

Projectitis
  • 343
  • 2
  • 9
  • If you are not compiling in release mode, it surprising that you define DEBUG flag ! Try removing -DDEBUG from the command line. – etham Jul 30 '21 at 09:34
  • Thanks Etham. I actually started without the DEBUG flag, and I have progressively added more and more flags to try and make it work. All results in the same thing - a lib with iterator debug level of 0, whereas I need it to be 2. – Projectitis Jul 30 '21 at 22:06

1 Answers1

0

The following two things combined solved this problem for me:

  1. Pass in the flag _DEBUG as well as DEBUG
  2. Run make using PowerShell instead of bash

This allowed me to compile a static library in debug mode with _ITERATOR_DEBUG_LEVEL of 2.

Projectitis
  • 343
  • 2
  • 9