CefView / QCefView

A Qt Widget encapsulated CEF view based on QWidget
https://cefview.github.io/QCefView/
GNU Lesser General Public License v2.1
529 stars 137 forks source link

您好,Linux环境下Qt生成的QCefViewTest不能执行 #35

Closed ZhaoSZun closed 2 years ago

ZhaoSZun commented 2 years ago

Linux下cmake生成的QCefViewTest使用命令可执行成功。但是使用qmake -project 生成的项目在Qt 中运行,生成的QCefViewTest使用./QCefViewTest 执行后失败,终端显示到 QFactoryLoader::QFactoryLoader() checking directory path "/home/zhaosz/work/library/QCefView/example/build-QCefViewTest-Desktop_Qt_5_12_10_GCC_64bit-Debug/styles" ... 卡着不动了。debug 项目时执行到main函数中的 QCefContext cefContext(&a, &config); 卡着不动。

image

tishion commented 2 years ago

这个看起来是Qt初始化的问题,跟CEF无关,你是用cmake生成项目?然后用qmake构建?

我开发过程一直是直接用Qt Creator构建,你先试试这样有没有问题。

ZhaoSZun commented 2 years ago

是的,./generate-linux-proj.sh -b 编译构建了QCefView,然后用qmake 构建了QCefViewTest 这个demo,引用了QCefView生成的动态库,使用Qt Creator调试时不能执行成功,执行到main函数中的 QCefContext cefContext(&a, &config); 卡着不动。 image

tishion commented 2 years ago

cef相关的文件都需要拷贝到可执行程序的同目录

ZhaoSZun commented 2 years ago

cef相关的文件都需要拷贝到可执行程序的同目录

拷贝了,把动态库都拷进来了。不报错不好定位原因 image image

ZhaoSZun commented 2 years ago

已找到原因,要先加载libcef.so

On linux platform and debug mode, libcef.so MUST be loaded before libc.so.

  # Gnerally we can achive this by using LD_PRELOAD=libcef.so, but this is not 
  # convenience for debugging. 
  # Thus, here we do a trick to make sure the load order
tishion commented 2 years ago

请帮忙关闭issue,谢谢