ITERATOR_DEBUG_LEVEL mismatch when building with draco library

When building from the 7.8.1 tag with Draco compression, I didn't encounter any problems.

But after moving to the latest OCCT in master branch and building, I'm getting several errors like this one:

47>draco.lib(float_points_tree_decoder.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in RWGltf_CafReader.obj
47>draco.lib(mesh_misc_functions.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in RWGltf_CafReader.obj
47>draco.lib(mesh_misc_functions.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in RWGltf_CafReader.obj
47>draco.lib(attributes_encoder.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in RWGltf_CafReader.obj
47>draco.lib(attributes_encoder.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in RWGltf_CafReader.obj
47>draco.lib(sequential_attribute_encoder.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in RWGltf_CafReader.obj

I've been using the draco 1.4.1 library package that's linked here on the site, so I tried building from the source and still got this result.

Is there a workaround for this?

Dmitrii Pasukhin's picture

Hello. It is a regression after some fix. The possible workaround is to change 3RDPARTY_DRACO_LIBRARY to be equal with 3RDPARTY_DRACO_LIBRARY_DEBUG. And build like that.

I will fix that issue on current week master. My apologies. You are welcome to report your bugs directly: Reporting bugs or feature request in GitHub

Best regards, Dmitrii.

Dmitrii Pasukhin's picture

PR: Configuration - Debug Draco linking issue Soon will be merged to master

Best regards, Dmitrii.

Elias Cohenca's picture

Thanks Dmitrii. In the meantime I found where the problem is. After CONFIGURE_DRACO_DEPS was moved from occt_toolkit.cmake to 3rdparty_macro.cmake, the lines:
```
if ("${CURRENT_CSF}" STREQUAL "${CSF_Draco}")
set (CURRENT_CSF "")
```
were removed from occt_toolkit.cmake.
That means that now the release library is included twice, once from each cmake file. If that condition is restored to occt_toolkit, it will only be included once.

Elias Cohenca's picture

Ah, I replied before refreshing. I see your PR now which is much more thorough. Thanks!