0

Please help if you can:

I am trying to inlcude the CEF library to my project, i have been suffering for the third day and have the following error:
here are my sequential actions:

1.I downloaded the precompiled CEF files: https://cef-builds.spotifycdn.com/index.html#windows32

2.Next, I perform the steps described on the page [Dynamic Linking (with a CEF DLL)]:https://bitbucket.org/chromiumembedded/cef/wiki/LinkingDifferentRunTimeLibraries

3.I started Cmake configured and generated the project with the /MT flag.

4.I opened the created sln project in VS2019 and compiled the release and debug versions ---> libcef_dll_wrapper: -I built the Release version with the MT flag. -I built the Debug version with the MTd flag.

5.Now I have created my new project, to which I have connected all the necessary .lib files:

#pragma comment(lib, "cef_dll_wrapper.lib")
#pragma comment(lib, "libcef.lib")
#pragma comment(lib, "cef_sandbox.lib")

6.Next I add just one function from the CEF library:

int main()
{
 CefEnableHighDPISupport();
}

7.And I compile in the release version - everything compiles successfully!

8.Now I am changing the cef_dll_wrapper.lib file from the release version to the debug version that I compiled in step 4.

And that's it! The project does not compile, and VS2019 reports an error:

LNK2038 a mismatch was detected for "_ITERATOR_DEBUG_LEVEL": the value "0" does not match the value "2"

I don't understand why everything compiles successfully in the release version, but not in debug.

I don't know what to do anymore :(

Has anyone ever encountered this ?

273K
  • 29,503
  • 10
  • 41
  • 64
Optimus1
  • 444
  • 2
  • 13
  • ***Has anyone ever encountered this ?*** Yes I have had this myself in the distant past. This happens most often when you mix debug and release when using msvc. All c++ libraries must be compiled under the same configuration as your executable otherwise you run into problems like this and also UB because the Debug CRT and standard library are implemented differently (classes, structures ... have different size in debug versus release) in debug and release mode to allow for better debugging. – drescherjm Jan 27 '22 at 15:07
  • @drescherjm, So that's the problem - I DIDN'T MIX debug and release, as I wrote in my first post - I compiled debug and release separately, but the error still occurs. But the question was taken and closed. – Optimus1 Jan 27 '22 at 15:14

0 Answers0