On the use of Qt CEF points of Windows
- 2020-05-26 09:53:06
Here are a few of the key points for using CEF (Chromium Embedded Framework) in a recent project.
Download the appropriate version of CEF
We won't talk about the introduction of CEF here. There are two options for downloading CEF:
1, source code: it is strongly not recommended to download the source code and compile the build (except to learn the code), download the source code requires you FQ, a good network speed (to download) and enough patience (it is said that there are 4, 5 G, really want to half a day).
2. Automatic build version: this version is recommended. This version provides most of the dynamic libraries and resources that have been compiled, requiring only the developer to manually compile one wrapper static library. This version is divided into the current release branch (Current Release Branches) and the legacy release branch (Legacy Release Branches), each with its own compilation requirements and minimum support for WinXp.
Compile the wrapper static library using CMake and VS
Call CMake to generate a corresponding VS project, then open and compile with VS, which is the most convenient method under windows (it is not recommended to configure CMake to compile). Here are the steps:
Install VS and CMake (32-bit)
Download and extract the automatic build version of the CEF package.
Open the developer command prompt for VS, cd to the unzipped root directory (the directory containing README.txt).
Run the command cmake-G "Visual Studio 14" (14 for VS2015, 12 for VS2013), which generates the cef.sln file in the root directory.
Double-click cef.sln to open the project with VS.
Make sure your Qt and CEF versions 1 are there
Runtime version 1. When using the CEF library, make sure that the entire program's runtime link version is 1, which means that the Qt static library and the CEF library must be compiled with the same runtime option. But crucial 1 point here is to make CEF (automated build version) library libcef. dll dynamic libraries are used/MT option precompiled good (at least I've tried several CEF automatically builds are open/MT compilation), we can only change Qt library version, can consider to replace these conflicts version, recompile or download the corresponding version is right choice.
Debug/Release mode 1 to. Otherwise, 1 series errors such as _ITERATOR_DEBUG_LEVEL will occur.
Only the older branch version of CEF supports the WinXp system, while the automatic build version only supports Win7 and above, so there is no way you can get CEF's WinXp support from the official source except by compiling from the source. Well, then the source code compilation is not realistic, only to ask someone else.
Documentation to support
The CEF documentation is not at the QT1 level, so don't expect to get started quickly. You'd better read all the documents other than API before you write the code.