Windows中集成libcef(MD)

2023-11-30  本文已影响0人  拉普拉斯妖kk

下载地址

libcef最新的下载地址

官方文档

参考官方文档,内容如下:

Dynamic Linking (with a CEF DLL)
If you prefer to link CEF with your application dynamically then the process is faster. CEF provides a binary distribution on the downloads page that contains everything you need to link CEF with your application including source code for the libcef_dll_wrapper project. If your application does not use the /MT flag then you will need to rebuild the libcef_dll_wrapper project with the same flags as your application. Unlike with static linking, you will not need to rebuild all of CEF or Chromium in order to do this.

Download a CEF binary release from the project downloads page.
Run CMake with the additional -DCEF_RUNTIME_LIBRARY_FLAG=/MD command-line flag (/MD can be replaced with other flags as appropriate).
Open cef.sln in Visual Studio.
Right click on the libcef_dll_wrapper project and choose the "Project Only -> Build Only libcef_dll_wrapper" option.
Sandbox support (linking cef_sandbox.lib) is only possible when your application is built with the /MT flag.

编译

ps:可能遇到问题:
error C2220: 警告被视为错误 - 没有生成 “object” 文件,解决方法配置属性 =》C/C++=》常规 =》将警告视为错误改为否 (/WX-)

使用

将Debug、Release、include、Resources以及刚刚编译的libcef_dll_wrapper中的库拷贝到需要使用的工程目录中,并配置好路径。

上一篇 下一篇

猜你喜欢

热点阅读