Build Error: 'override' Specifier on Non-virtual Function

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Build Error: 'override' Specifier on Non-virtual Function

Postby aleitner » Fri Feb 23, 2024 9:57 am

I recently ran into the "crash when accessing FirstPartySets" bug when using libcef (version 119.4.7+g55e15c8+chromium-119.0.6045.199) so I decided to update to the latest version, and I've run into a build error that I'm having trouble resolving. After updating, the following error occurs during the build process:

Code: Select all
In file included from ../../cef/libcef/browser/osr/render_widget_host_view_osr.h:18:
../../cef/libcef/browser/osr/host_display_client_osr.h:41:58: error: only virtual member functions can be marked 'override'
   41 |   void DidCompleteSwapWithNewSize(const gfx::Size& size) override;
      |                                                          ^~~~~~~~


It seems like DidCompleteSwapWithNewSize is marked as override in host_display_client_osr.h, but the compiler is indicating that it is not actually overriding a virtual member function from the base class.

Any suggestions or guidance would be greatly appreciated as I am currently blocked by this build error. I do have to manually build libcef because I need to build with ozone support for headless browsing

This error occurs for both versions that I have tried building
121.3.13+g5c4a81b+chromium-121.0.6167.184
121.3.15+g4d3b0b4+chromium-121.0.6167.184
aleitner
Mentor
 
Posts: 60
Joined: Fri Jun 16, 2023 12:05 pm

Re: Build Error: 'override' Specifier on Non-virtual Functio

Postby magreenblatt » Fri Feb 23, 2024 12:15 pm

What commands are you using to download and build Chromium/CEF? Are there any errors earlier in the download or build process?
magreenblatt
Site Admin
 
Posts: 12744
Joined: Fri May 29, 2009 6:57 pm

Re: Build Error: 'override' Specifier on Non-virtual Functio

Postby aleitner » Fri Feb 23, 2024 12:58 pm

magreenblatt wrote:What commands are you using to download and build Chromium/CEF? Are there any errors earlier in the download or build process?


Here are the defines.
Code: Select all
GN_DEFINES='
is_official_build=true
is_debug=false
chrome_pgo_phase=0
use_sysroot=true
symbol_level=1
is_cfi=false
use_thin_lto=false
use_vaapi=false
use_allocator=none
use_ozone=true
ozone_auto_platforms=false
ozone_platform_headless=true
ozone_platform_x11=false
ozone_platform_wayland=false
ozone_platform_drm=false'


I encounter the issue both when running a completely automatic build and when running each step manually.

Code: Select all
python3.9 /home/build/rpmbuild/SOURCES/automate-git.py --download-dir=/home/build/rpmbuild/BUILD/chromium_git --checkout=4d3b0b4 --no-distrib --no-build --force-clean --force-clean-deps


Code: Select all
    python3 "${AUTOMATE_SCRIPT}" \
    --download-dir="${CHROMIUM_DIR}" \
    --checkout="${CEF_COMMIT_HASH}" \
    --no-distrib \
    --no-build \
    --force-clean \
    --force-clean-deps

    # Update PATH
    export PATH="${CHROMIUM_DIR}/depot_tools:$PATH"
   
    cd "${CEF_DIR}"
    ./cef_create_projects.sh
   
    cd "${CHROMIUM_DIR}/chromium/src"
    autoninja -C "${OUT_DIR}" cefsimple chrome_sandbox
   
    cd "${CEF_DIR}/tools"
    ./make_distrib.sh --ninja-build --no-symbols --no-docs --no-archive --minimal --distrib-subdir=libcef --x64-build
aleitner
Mentor
 
Posts: 60
Joined: Fri Jun 16, 2023 12:05 pm

Re: Build Error: 'override' Specifier on Non-virtual Functio

Postby magreenblatt » Fri Feb 23, 2024 1:06 pm

It looks like the DidCompleteSwapWithNewSize method is only used with Ozone/X11. You’re disabling that, so you need to add the related BUILDFLAG checks in host_display_client_osr.[cc|h]. See for example https://source.chromium.org/chromium/ch ... s=chromium
magreenblatt
Site Admin
 
Posts: 12744
Joined: Fri May 29, 2009 6:57 pm

Re: Build Error: 'override' Specifier on Non-virtual Functio

Postby aleitner » Wed Feb 28, 2024 7:57 pm

It looks like this was snuck in just as I was going to create a patch. :D

https://github.com/chromiumembedded/cef ... sr.cc#L148

I was able to successfully build with ozone headless. This bug is now fixed
aleitner
Mentor
 
Posts: 60
Joined: Fri Jun 16, 2023 12:05 pm


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 7 guests