DEBUG Build has _ITERATOR_DEBUG_LEVEL 0

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

DEBUG Build has _ITERATOR_DEBUG_LEVEL 0

Postby linuxcef9 » Fri May 10, 2019 1:58 am

Hi,

I am building cefsimple debug x64 version based on branch 3729 on windows 10. In file src\out\Debug_GN_X64\args.gn, I've following defines:

clang_use_chrome_plugins=false
enable_basic_printing=true
enable_iterator_debugging=true
enable_nacl=false
enable_precompiled_headers=false
enable_print_preview=false
enable_widevine=true
ffmpeg_branding="Chrome"
is_component_build=false
is_debug=true
proprietary_codecs=true
target_cpu="x64"
use_jumbo_build=true

Note that I added enable_iterator_debugging=true as per your commit https://bitbucket.org/chromiumembedded/ ... ts/7aae02e

I consume the version of libcef_dll_wrapper.lib generated from above build inside my app. However, when I build my app in debug mode, it links with Debug_GN_X64 libcef_dll_wrapper.lib but I get lots of errors like :

libcef_dll_wrapper.lib(browser_view_ctocpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in MyCustom_app.obj

When my app is built in release mode, it consume release _gn_x64 version of libcef_dll_wrapper.lib and that works fine. But why am i getting an error for debug build?
Can you help? Do I need to add any flag to ensure debug_gn_x64 version of libcef_dll_wrapper.lib has ITERATOR_DEBUG_LEVEL = 2 ?

I verified that libcef_dll_wrapper.ninja has /MTd in CFLAGS and -D_DEBUG in defines. My custom player also uses /MTd flag with -D_DEBUG defines.

Thanks in advance.
linuxcef9
Expert
 
Posts: 143
Joined: Tue Nov 06, 2018 3:08 pm

Re: DEBUG Build has _ITERATOR_DEBUG_LEVEL 0

Postby magreenblatt » Fri May 10, 2019 10:42 am

Official Debug builds of CEF are actually Release builds with debug checking enabled. You can find the configuration at https://bitbucket.org/chromiumembedded/ ... figuration
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: DEBUG Build has _ITERATOR_DEBUG_LEVEL 0

Postby linuxcef9 » Fri May 10, 2019 11:02 am

HI marshall,

Sorry but I am a bit confused. If debug builds have debug checking enabled, does it mean they've _ITERATOR_DEBUG_LEVEL set to 2? Because I am seeing it being set to 0.

I am not sure what I should be looking at here : https://bitbucket.org/chromiumembedded/ ... figuration. My paths and other environment variables seem to be set correctly. I folllowed https://bitbucket.org/chromiumembedded/ ... dows-setup and passed the appropriate arguments to automate-git.py.

What should I do to ensure that debug builds have _ITERATOR_DEBUG_LEVEL set to 2?

ALso, I didn't have this issue with previous build of cef like 3282 etc. Was something changed in the interim which caused this issue?
linuxcef9
Expert
 
Posts: 143
Joined: Tue Nov 06, 2018 3:08 pm

Re: DEBUG Build has _ITERATOR_DEBUG_LEVEL 0

Postby magreenblatt » Fri May 10, 2019 11:12 am

You should create a binary distribution and use that with your application. When you build with the binary distribution it builds libcef_dll_wrapper with the configuration specified by CMake. That is different from the configuration used when building CEF/Chromium.

(Edited for clarity)
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: DEBUG Build has _ITERATOR_DEBUG_LEVEL 0

Postby linuxcef9 » Fri May 10, 2019 11:32 am

By binary distribution, do you mean building http://opensource.spotify.com/cefbuilds/index.html ?

The confusing part for me is that for earlier branches, I built full CEF following instructions at https://bitbucket.org/chromiumembedded/ ... dows-setup . Then, I compiled my own app, linking to libcef.dll and libcef_dll_wrapper.lib from above CEF build and everything worked fine (for both, obj and release builds).

But for some reason, with 3729 version of cef, the obj builds are causing an issue.
linuxcef9
Expert
 
Posts: 143
Joined: Tue Nov 06, 2018 3:08 pm

Re: DEBUG Build has _ITERATOR_DEBUG_LEVEL 0

Postby magreenblatt » Fri May 10, 2019 11:49 am

You can create a binary distribution from your local build by running the make_distrib.py script. We only test integration with external applications when using a binary distribution, because that allows us to control the build configuration for libcef_dll_wrapper which is statically linked into the client application. Otherwise, you're at the mercy of whatever settings Chromium is using on a given day, which may not match the settings that you want.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: DEBUG Build has _ITERATOR_DEBUG_LEVEL 0

Postby magreenblatt » Fri May 10, 2019 12:18 pm

To provide a bit more background, enable_iterator_debugging=true should not be used when building Chromium (see this issue). We currently make a separate build of just cef_sandbox.lib and minimal Chromium dependencies to work around these types of problems (see issue #1961, issue #2220, issue #2592).
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: DEBUG Build has _ITERATOR_DEBUG_LEVEL 0

Postby linuxcef9 » Sat May 11, 2019 12:06 pm

Thanks for the reply marshall, much appreciated.

To work around the problem, here's what I did :

1) First, I let the debug build happen without any modifications
2) I patched chromium\src\cef\BUILD.gn to add _ITERATOR_DEBUG_LEVEL=2 and _HAS_ITERATOR_DEBUGGING=1 defines for libcef_dll_wrapper config
3) I patched chromium\src\build\config\BUILD.gn to have _HAS_ITERATOR_DEBUGGING=1
4) run ninja -C out\Debug_GN_<arch> libcef_dll_wrapper

That seemed to build libcef_dll_Wrapper.lib with the correct macros/flags I wanted and my application could consume it fine.
linuxcef9
Expert
 
Posts: 143
Joined: Tue Nov 06, 2018 3:08 pm

Re: DEBUG Build has _ITERATOR_DEBUG_LEVEL 0

Postby Staxcelrom » Wed Feb 09, 2022 11:29 am

Absolutely the same error.
Staxcelrom
Expert
 
Posts: 206
Joined: Wed Jan 26, 2022 8:20 am

Re: DEBUG Build has _ITERATOR_DEBUG_LEVEL 0

Postby rsharma07 » Mon Feb 21, 2022 6:30 am

linuxcef9 wrote:Thanks for the reply marshall, much appreciated.

To work around the problem, here's what I did :

1) First, I let the debug build happen without any modifications
2) I patched chromium\src\cef\BUILD.gn to add _ITERATOR_DEBUG_LEVEL=2 and _HAS_ITERATOR_DEBUGGING=1 defines for libcef_dll_wrapper config
3) I patched chromium\src\build\config\BUILD.gn to have _HAS_ITERATOR_DEBUGGING=1
4) run ninja -C out\Debug_GN_<arch> libcef_dll_wrapper

That seemed to build libcef_dll_Wrapper.lib with the correct macros/flags I wanted and my application could consume it fine.


Hi all, I am also getting the same error with cef branch 4664, i followed https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart.md. I tried above steps but still getting the same error, seems i am doing some mistake, May anyone please share the exact changes and where to apply?

Please also share the exact configuration of src\out\Debug_GN_X64\args.gn.
Thanks
rsharma07
Techie
 
Posts: 17
Joined: Wed Oct 21, 2020 4:12 am

Next

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 140 guests