0

Working on a C++ application using WTL and would like to integrate CEF so we can develop some of the administrative functions for the application as a web app, and embed it into our desktop app.

I've installed the cef.redist.x64 (97.1.1) NuGet package, as well as the cef.sdk (97.1.1) NuGet package.

I'm not sure what the next steps are to implement a control which has a simple frameless browser window that we feed a url to. In an ideal world there would be an example using WTL's CWindowImpl out there, but I'm not sure what structures the control should have. Questions like:

  1. Does each control have it's own CefWindowInfo that persists as long as the control is alive?
  2. Should I make the control the handler?

Additionally, when I try to build, I'm getting linker errors: A bunch of these: Code: LNK2005 Description: xxxxx already defined in MyClassXXX.obj File: msvcprtd.lib (MSVCP140D.dll)

And a bunch of these: Code: LNK2038 Description: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in DebenuPDFLibraryDLL1011.obj File: libcef_dll_wrapper.lib(cef_logging.obj)

Any thoughts on the errors?

bpeikes
  • 3,495
  • 9
  • 42
  • 80
  • `MDd_DynamicDebug` vs `'MTd_StaticDebug` - check Project->Properties->C/C++->Code Generation->Runtime Library. All parst shoud have same value `Multi-threaded Debug (/MTd)` or `Multi-threaded Debug DLL (/MDd)` and for Release `Multi-threaded (/MT)` or `Multi-threaded DLL (/MD)` – Daniel SÄ™k Jan 14 '22 at 09:33
  • The lib files included in cef.sdk are dynamically linked. – amaitland Jan 16 '22 at 09:22

1 Answers1

0

I suggest you could refer to the CEF's main sample application, cefclient.

And you could also refer to the thread:How to use Chromium Embedded Framework with Visual Studio 2017 (C++)?

Error LNK2005: this error means you have broken the one definition rule

Error LNK2038:This error can occur when an object file in your project is out-of-date.Before you try other solutions to this error, perform a clean build to ensure that the object files are current.

Jeaninez - MSFT
  • 3,210
  • 1
  • 5
  • 20
  • 1
    The link you provided really only goes over how to generate a new project. I have an existing one. – bpeikes Jan 15 '22 at 16:20