9

I would like to use CEF with VS 2017 using C++ (not C#, so CEFSharp won't work here). I can't quite understand how to do this. From what I have read, it seems like I need to build the source into a .sln file and then modify the existing code, however their site also says there are binaries available to download, which is confusing me.

How do I program in C++ using CEF and VS 2017?

otah007
  • 505
  • 1
  • 4
  • 17
  • You can download and use pre-built binaries. Standard distribution includes binaries as well as sample project which can be used for start. cefclient more complex, may be have sense to start with cefsimple instead. Standard distrib also includes cmake to generate project for your IDE and/or platform. – Dmitry Azaraev Jul 17 '17 at 11:58
  • @fddima So the binaries are for building a project via cmake, which can then be used in VS? – otah007 Jul 17 '17 at 15:39
  • cmake can generating projects for you. you can do same without cmake, but i prefer reuse this things from distribution. at least there is good start point. then - i can only suggest CEF wiki for rest. Also CEF forum is greatest place for CEF questions. – Dmitry Azaraev Jul 17 '17 at 16:16

1 Answers1

18
  1. Download CEF3 binaries, and extract archive to folder
  2. Download and install CMake
  3. Open CMake, and set:
    • Where is the source code: folder
    • Where to build the binaries: folder/build
  4. Press Configure
  5. Press Generate
  6. Open solution in folder/build/cef.sln
  7. Build Debug/Release
  8. Reference in your project folder/build/libcef_dll_wrapper/[Debug|Release]/libcef_dll_wrapper.lib
  9. Copy files to your bin folder:
    • folder/[Debug|Release]
    • folder/Resources
Spej
  • 31
  • 3
  • 6
Sga
  • 3,608
  • 2
  • 36
  • 47
  • 1
    You'll want to download the "Standard Distribution" version of CEF from the downloads site. – psyklopz Jul 20 '18 at 19:11
  • 7 means build ALL_BUILD?. 8 and 9 are unclear to me, can you please explain the two points in more detail? – Ini Mar 04 '19 at 21:22
  • 2
    7 = `Build->Build solution`; 8 = `Linker->Additional dependencies`; 9 = copy DLLs whenever your executable is – Sga Mar 06 '19 at 08:56
  • Ther eis no Additional dependendencies options under Linker in vs2017. Maybe it's Additional Library Directories? Which is set to `%(AdditionalLibraryDirectories)`, is that correct? Under cefsimple-project > References the dependencies are marked with a yellow triangle. I cannot find anything on what that is and how to solve it. – Ini Mar 06 '19 at 21:23