CEF4Delphi under Ubuntu CEF binaries missing lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Forest · 2023-04-09 13:36 Does anybody is using CEF4Delphi under Lazaus and Ubuntu or other GTK linux ? I have cef missing libraries error even when .so files are in application directory. I think it is not locating them. How to debug this problem, I saw somewhere that I can set path to libraries in code , do you know where ? ---------------------------------------------------------------------- loaded · 2023-04-09 14:03 This is how I use it on windows. Lpr File ; Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program Pline_Manager; {$mode objfpc}{$H+} uses  uCEFApplication,  {$IFDEF UNIX}{$IFDEF UseCThreads}  cthreads,  {$ENDIF}{$ENDIF}  Interfaces, // this includes the LCL widgetset  Forms, Unit_Main, Unit_ExtensionHandler   { you can add units after this }; {$R *.res} begin  CreateGlobalCEFApp; //The library path is defined in this method.    if GlobalCEFApp.StartMainProcess then    begin    RequireDerivedFormResource:=True;    Application.Title:='Pline Manager';    Application.Scaled:=True;    Application.Initialize;    Application.CreateForm(TForm_Main, Form_Main);    Application.Run;    end;  DestroyGlobalCEFApp;end.  Unit_Main file ; Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure CreateGlobalCEFApp;begin  GlobalCEFApp                     := TCefApplication.Create;  GlobalCEFApp.cache               := 'cache';  GlobalCEFApp.LogFile             := 'cache\debug.log';  GlobalCEFApp.LogSeverity         := LOGSEVERITY_INFO;  GlobalCEFApp.EnablePrintPreview  := True;  GlobalCEFApp.OnWebKitInitialized := @GlobalCEFApp_OnWebKitInitialized;   GlobalCEFApp.FrameworkDirPath := UTF8ToCP1254(ExtractFilePath(ParamStr(0))) + 'Libraries\';  GlobalCEFApp.ResourcesDirPath := UTF8ToCP1254(ExtractFilePath(ParamStr(0))) + 'Libraries\';  GlobalCEFApp.LocalesDirPath := UTF8ToCP1254(ExtractFilePath(ParamStr(0)))   + 'Libraries\locales';end; ---------------------------------------------------------------------- Forest · 2023-04-09 18:46 UTF8ToCP1254 is required ? In my case should it be UTF8ToCP1250 for Eastern Europe ? In which unit it is declared ? ---------------------------------------------------------------------- Forest · 2023-04-09 18:58 Ok, thanks, it seems to be broken under GTK, still insist on missing cef files ---------------------------------------------------------------------- loaded · 2023-04-09 19:23 Quote from: Forest on April 09, 2023, 08:46:27 pmUTF8ToCP1254 is required ? In my case should it be UTF8ToCP1250 for Eastern Europe ? In which unit it is declared ? In my case, it should be used when language-specific characters ğ,ü,ş,ı,ö,ç are used. You can test it yourself by experimenting. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses lconvencoding; Quote from: Forest on April 09, 2023, 08:58:48 pmOk, thanks, it seems to be broken under GTK, still insist on missing cef files Maybe there is a compatibility problem between the CEF4Delphi version you are using and the required CEF version! Moreover ; @salvadordf, author of CEF4Delphi, is a member of this forum and very helpful. If you contact him, he will help you. ---------------------------------------------------------------------- salvadordf · 2023-04-11 20:07 Hi, CEF4Delphi works with GTK2 and only a few demos work in GTK3. There's a feature request to add QT support : https://github.com/salvadordf/CEF4Delphi/issues/440 There's an issue with GTK3 in the latest versions : https://github.com/salvadordf/CEF4Delphi/issues/441 Use this CEF4Delphi release to avoid that issue : https://github.com/salvadordf/CEF4Delphi/releases/tag/106.0.5249.119 This package contains the CEF binaries for that release : https://cef-builds.spotifycdn.com/cef_binary_106.1.1%2Bg5891c70%2Bchro mium-106.0.5249.119_linux64.tar.bz2 Follow this guide to copy the binaries : https://github.com/salvadordf/CEF4Delphi/wiki/Before-you-run-the-demos Take a look at the attached image and try to replicate the layout. ---------------------------------------------------------------------- rca · 2023-04-15 21:17 @salvadordf I can confirm that by following your instructions, CEF4Delphi works very well inside Ubuntu x86 64-bit. I tried with 2 examples: SimpleBrowser and MiniBrowser. And they worked fine with the RPi4 inside the 64-bit Raspberry Pi operating system, too. But I can't get those same examples to work with the same RPi4 inside Ubuntu Desktop OS arm64. Neither within Fedora OS aarch64. It compiles correctly, but I only get a small blank screen. (Image attached) Does not show errors. To test that CEF4Delphi, if it is checking the libraries, I changed the library name to "libEGL1.so" included inside the "Release" folder. And the same small blank screen appears again, but with the message "CEF binaries missing !" (Image attached) I downloaded the "Sample Application", ran "cefsimple" and it works fine. That is, it is not a problem that a library is missing within the operating system. Inside the MiniBrowser Example, I have:   Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure CreateGlobalCEFApp;begin  GlobalCEFApp                     := TCefApplication.Create;  GlobalCEFApp.cache               := 'cache';  GlobalCEFApp.LogFile             := 'debug.log';  GlobalCEFApp.LogSeverity         := LOGSEVERITY_VERBOSE;end; It does not create any debug.log files. And if I create it manually, it stays empty. I also added the following messages with writeln Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   CreateGlobalCEFApp;   writeln('Step 01');   if GlobalCEFApp.StartMainProcess then    begin      // The LCL Widgetset must be initialized after the CEF initialization and      // only in the browser process.      writeln('Step 02');      CustomWidgetSetInitialization;      RequireDerivedFormResource:=True;      Application.Scaled:=True;      Application.Initialize;      Application.CreateForm(TMiniBrowserFrm, MiniBrowserFrm);      Application.Run;      CustomWidgetSetFinalization;    end    else    begin      writeln('Step 03');    end;   DestroyGlobalCEFApp;     And just display "Step 01" ---------------------------------------------------------------------- salvadordf · 2023-04-18 12:59 Thanks for reporting this issue! There seems to be an initialization problem and I'll have to compare it with cefsimple. https://github.com/salvadordf/CEF4Delphi/issues/457 ---------------------------------------------------------------------- myisjwj · 2023-05-31 12:51 I also encountered the same problem on Linuxarm64. Using getconf PAGESIZE, it is 65536. Some people say that the PAGESIZE of libcef.so is 4096, and all errors occur. Is it possible? How to solve it? use cef_binary_87.1.14 ---------------------------------------------------------------------- myisjwj · 2023-07-10 12:11 run ---------------------------------------------------------------------- myisjwj · 2023-07-10 12:12 getconf PAGESIZE ---------------------------------------------------------------------- myisjwj · 2023-11-01 02:29 For CEF4_87. 0.4280.141 LinuxAarch64 cannot be getconf PAGESIZE system of 64 k. Since Chromium will not be compiled, the following attempts can only be made: The platform is: Ubuntu Server 20.04 arm64 pagesize=4k CEF4_87.0.4280.141LinuxArmhf pagesize=64K 1. Use dpkg --add-architecture armhf Added Armhf runtime support. 2. Use apt to increase the dependency packages required by CEF. Note that apt install xxxx:armhf is used to add the package. Also use ln -s /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 /lib/ld-linux-armhf.so3 to install the loader. 3. After all the dependencies are added, CEF can run normally and display web pages. Question: Perform the following operations in the Kylin arm64 pagesize=64K environment. 1. Copy all files of /lib/arm-linux-gnueabihf in Ubuntu to the corresponding directory of Kylin. 2. Since the pagesize of libLLVM-15.so.1 =4k, find the libLLVM15 for armhf dependency package with pagesize=64K. And download libncursesw.so.6 dependency. Copy them all to /lib/arm-linux- gnueabihf. 3. ln -s /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 /lib/ld-linux- armhf.so3 In this case, the CEF test program can be run, but the error "fatal:page_allocator_internals_posix.h(169) check failed" occurs twice. And the interface is blank and does not load the page. Display thread discovery with ps Ubuntu Server 20.04 arm64 cef has 6 threads The cef in Kylin arm64 has only 5 threads. View pagesize with readelf -l xxx.so. After LOAD, 0x1000 is 4K, and 0x10000 is 64K.