Recent

Author Topic: CEF4Delphi under Ubuntu CEF binaries missing  (Read 5009 times)

Forest

  • New Member
  • *
  • Posts: 16
CEF4Delphi under Ubuntu CEF binaries missing
« on: April 09, 2023, 03:36:21 pm »
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

  • Hero Member
  • *****
  • Posts: 824
Re: CEF4Delphi under Ubuntu CEF binaries missing
« Reply #1 on: April 09, 2023, 04:03:19 pm »
This is how I use it on windows.

Lpr File ;
Code: Pascal  [Select][+][-]
  1. program Pline_Manager;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6.   uCEFApplication,
  7.   {$IFDEF UNIX}{$IFDEF UseCThreads}
  8.   cthreads,
  9.   {$ENDIF}{$ENDIF}
  10.   Interfaces, // this includes the LCL widgetset
  11.   Forms, Unit_Main, Unit_ExtensionHandler
  12.    { you can add units after this };
  13.  
  14. {$R *.res}
  15.  
  16. begin
  17.   CreateGlobalCEFApp; //The library path is defined in this method.
  18.     if GlobalCEFApp.StartMainProcess then
  19.     begin
  20.     RequireDerivedFormResource:=True;
  21.     Application.Title:='Pline Manager';
  22.     Application.Scaled:=True;
  23.     Application.Initialize;
  24.     Application.CreateForm(TForm_Main, Form_Main);
  25.     Application.Run;
  26.     end;
  27.   DestroyGlobalCEFApp;
  28. end.
  29.  


Unit_Main file ;
Code: Pascal  [Select][+][-]
  1. procedure CreateGlobalCEFApp;
  2. begin
  3.   GlobalCEFApp                     := TCefApplication.Create;
  4.   GlobalCEFApp.cache               := 'cache';
  5.   GlobalCEFApp.LogFile             := 'cache\debug.log';
  6.   GlobalCEFApp.LogSeverity         := LOGSEVERITY_INFO;
  7.   GlobalCEFApp.EnablePrintPreview  := True;
  8.   GlobalCEFApp.OnWebKitInitialized := @GlobalCEFApp_OnWebKitInitialized;
  9.  
  10.   GlobalCEFApp.FrameworkDirPath := UTF8ToCP1254(ExtractFilePath(ParamStr(0))) + 'Libraries\';
  11.   GlobalCEFApp.ResourcesDirPath := UTF8ToCP1254(ExtractFilePath(ParamStr(0))) + 'Libraries\';
  12.   GlobalCEFApp.LocalesDirPath := UTF8ToCP1254(ExtractFilePath(ParamStr(0)))   + 'Libraries\locales';
  13. end;
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

Forest

  • New Member
  • *
  • Posts: 16
Re: CEF4Delphi under Ubuntu CEF binaries missing
« Reply #2 on: April 09, 2023, 08:46:27 pm »
UTF8ToCP1254 is required ? In my case should it be UTF8ToCP1250 for Eastern Europe ? In which unit it is declared ?

Forest

  • New Member
  • *
  • Posts: 16
Re: CEF4Delphi under Ubuntu CEF binaries missing
« Reply #3 on: April 09, 2023, 08:58:48 pm »
Ok, thanks, it seems to be broken under GTK, still insist on missing cef files

loaded

  • Hero Member
  • *****
  • Posts: 824
Re: CEF4Delphi under Ubuntu CEF binaries missing
« Reply #4 on: April 09, 2023, 09:23:04 pm »
UTF8ToCP1254 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][+][-]
  1. uses lconvencoding;


Ok, 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.
« Last Edit: April 09, 2023, 09:26:37 pm by loaded »
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

salvadordf

  • New Member
  • *
  • Posts: 47
    • BriskBard
Re: CEF4Delphi under Ubuntu CEF binaries missing
« Reply #5 on: April 11, 2023, 10:07:04 pm »
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%2Bchromium-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.
Maintainer of the CEF4Delphi, WebView4Delphi, WebUI4Delphi and WebUI4CSharp projects

rca

  • Jr. Member
  • **
  • Posts: 67
Re: CEF4Delphi under Ubuntu CEF binaries missing
« Reply #6 on: April 15, 2023, 11:17:07 pm »
@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][+][-]
  1. procedure CreateGlobalCEFApp;
  2. begin
  3.   GlobalCEFApp                     := TCefApplication.Create;
  4.   GlobalCEFApp.cache               := 'cache';
  5.   GlobalCEFApp.LogFile             := 'debug.log';
  6.   GlobalCEFApp.LogSeverity         := LOGSEVERITY_VERBOSE;
  7. end;  
  8.  

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][+][-]
  1.   CreateGlobalCEFApp;
  2.  
  3.   writeln('Step 01');
  4.  
  5.   if GlobalCEFApp.StartMainProcess then
  6.     begin
  7.       // The LCL Widgetset must be initialized after the CEF initialization and
  8.       // only in the browser process.
  9.       writeln('Step 02');
  10.       CustomWidgetSetInitialization;
  11.       RequireDerivedFormResource:=True;
  12.       Application.Scaled:=True;
  13.       Application.Initialize;
  14.       Application.CreateForm(TMiniBrowserFrm, MiniBrowserFrm);
  15.       Application.Run;
  16.       CustomWidgetSetFinalization;
  17.     end
  18.     else
  19.     begin
  20.       writeln('Step 03');
  21.     end;
  22.  
  23.   DestroyGlobalCEFApp;
  24.  

 
And just display "Step 01"

salvadordf

  • New Member
  • *
  • Posts: 47
    • BriskBard
Re: CEF4Delphi under Ubuntu CEF binaries missing
« Reply #7 on: April 18, 2023, 02:59:19 pm »
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
« Last Edit: April 18, 2023, 03:13:13 pm by salvadordf »
Maintainer of the CEF4Delphi, WebView4Delphi, WebUI4Delphi and WebUI4CSharp projects

myisjwj

  • Jr. Member
  • **
  • Posts: 69
Re: CEF4Delphi under Ubuntu CEF binaries missing
« Reply #8 on: May 31, 2023, 02:51:10 pm »
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

  • Jr. Member
  • **
  • Posts: 69
Re: CEF4Delphi under Ubuntu CEF binaries missing
« Reply #9 on: July 10, 2023, 02:11:02 pm »
run

myisjwj

  • Jr. Member
  • **
  • Posts: 69
Re: CEF4Delphi under Ubuntu CEF binaries missing
« Reply #10 on: July 10, 2023, 02:12:05 pm »
getconf PAGESIZE

myisjwj

  • Jr. Member
  • **
  • Posts: 69
Re: CEF4Delphi under Ubuntu CEF binaries missing
« Reply #11 on: November 01, 2023, 03:29:18 am »
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.

 

TinyPortal © 2005-2018