CEF - 4430 - Ubuntu 16.04 - undeclared GDK/GTK Objects

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CEF - 4430 - Ubuntu 16.04 - undeclared GDK/GTK Objects

Postby leeroy » Fri Apr 09, 2021 1:17 pm

Hi, we are running into an issue with building with Linux and getting undeclared GTK/GDK objects.

CEF: cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51
Linux: Ubuntu 16.04 server.

I was under the impression that use_gtk GN flag was a defaulted to true in this new version that should have taken care of this (Explicitly setting use_gtk=true makes no difference)?

Example output:
Code: Select all
In file included from /tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:16:0:
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.h:121:30: error: ‘GdkEventTouch’ has not been declared
                              GdkEventTouch* event,
                              ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc: In member function ‘void client::RootWindowGtk::CreateRootWindow(const CefBrowserSettings&, bool)’:
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:324:3: error: ‘GdkRGBA’ was not declared in this scope
   GdkRGBA rgba = {0};
   ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:325:3: error: ‘rgba’ was not declared in this scope
   rgba.red = CefColorGetR(background_color) * 65535 / 255;
   ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:331:56: error: ‘gdk_rgba_to_string’ was not declared in this scope
                                gdk_rgba_to_string(&rgba));
                                                        ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:332:3: error: ‘GtkCssProvider’ was not declared in this scope
   GtkCssProvider* provider = gtk_css_provider_new();
   ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:332:19: error: ‘provider’ was not declared in this scope
   GtkCssProvider* provider = gtk_css_provider_new();
                   ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:332:51: error: ‘gtk_css_provider_new’ was not declared in this scope
   GtkCssProvider* provider = gtk_css_provider_new();
                                                   ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:333:61: error: ‘gtk_css_provider_load_from_data’ was not declared in this scope
   gtk_css_provider_load_from_data(provider, css, -1, nullptr);
                                                             ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:335:70: error: ‘gtk_widget_get_style_context’ was not declared in this scope
   gtk_style_context_add_provider(gtk_widget_get_style_context(window_),
                                                                      ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:336:61: error: ‘GTK_STYLE_PROVIDER’ was not declared in this scope
                                  GTK_STYLE_PROVIDER(provider),
                                                             ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:337:34: error: ‘GTK_STYLE_PROVIDER_PRIORITY_APPLICATION’ was not declared in this scope
                                  GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
                                  ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:337:73: error: ‘gtk_style_context_add_provider’ was not declared in this scope
                                  GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
                                                                         ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:340:34: error: ‘gtk_grid_new’ was not declared in this scope
   GtkWidget* grid = gtk_grid_new();
                                  ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:341:48: error: ‘GTK_GRID’ was not declared in this scope
   gtk_grid_set_column_homogeneous(GTK_GRID(grid), TRUE);
                                                ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:341:55: error: ‘gtk_grid_set_column_homogeneous’ was not declared in this scope
   gtk_grid_set_column_homogeneous(GTK_GRID(grid), TRUE);
                                                       ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:351:57: error: ‘gtk_grid_attach’ was not declared in this scope
     gtk_grid_attach(GTK_GRID(grid), menu_bar, 0, 0, 1, 1);
                                                         ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc:395:33: error: ‘gtk_grid_attach_next_to’ was not declared in this scope
                             1, 1);
                                 ^
[ 94%] Building CXX object linux/CMakeFiles/MyApp.dir/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/temp_window_x11.cc.o
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-undefined-var-template’ [-Werror]
cc1plus: all warnings being treated as errors
linux/CMakeFiles/MyApp.dir/build.make:789: recipe for target 'linux/CMakeFiles/MyApp.dir/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc.o' failed
make[3]: *** [linux/CMakeFiles/MyApp.dir/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/root_window_gtk.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from /tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:5:0:
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.h:121:30: error: ‘GdkEventTouch’ has not been declared
                              GdkEventTouch* event,
                              ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc: In constructor ‘client::{anonymous}::ScopedGLContext::ScopedGLContext(GtkWidget*, bool)’:
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:909:48: error: ‘GTK_GL_AREA’ was not declared in this scope
     gtk_gl_area_make_current(GTK_GL_AREA(widget));
                                                ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:909:49: error: ‘gtk_gl_area_make_current’ was not declared in this scope
     gtk_gl_area_make_current(GTK_GL_AREA(widget));
                                                 ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:910:58: error: ‘gtk_gl_area_get_error’ was not declared in this scope
     is_valid_ = gtk_gl_area_get_error(GTK_GL_AREA(widget)) == NULL;
                                                          ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:912:52: error: ‘gtk_gl_area_queue_render’ was not declared in this scope
       gtk_gl_area_queue_render(GTK_GL_AREA(widget_));
                                                    ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:913:53: error: ‘gtk_gl_area_attach_buffers’ was not declared in this scope
       gtk_gl_area_attach_buffers(GTK_GL_AREA(widget));
                                                     ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc: In member function ‘void client::BrowserWindowOsrGtk::Create(GtkWidget*)’:
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:1352:29: error: ‘gtk_gl_area_new’ was not declared in this scope
   glarea_ = gtk_gl_area_new();
                             ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:1357:50: error: ‘GTK_GL_AREA’ was not declared in this scope
   gtk_gl_area_set_auto_render(GTK_GL_AREA(glarea_), FALSE);
                                                  ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:1357:58: error: ‘gtk_gl_area_set_auto_render’ was not declared in this scope
   gtk_gl_area_set_auto_render(GTK_GL_AREA(glarea_), FALSE);
                                                          ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:1393:39: error: ‘gtk_widget_set_vexpand’ was not declared in this scope
   gtk_widget_set_vexpand(glarea_, TRUE);
                                       ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:1394:41: error: ‘GTK_GRID’ was not declared in this scope
   gtk_grid_attach(GTK_GRID(parent_handle), glarea_, 0, 3, 1, 1);
                                         ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:1394:63: error: ‘gtk_grid_attach’ was not declared in this scope
   gtk_grid_attach(GTK_GRID(parent_handle), glarea_, 0, 3, 1, 1);
                                                               ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc: In static member function ‘static gint client::BrowserWindowOsrGtk::ScrollEvent(GtkWidget*, GdkEventScroll*, client::BrowserWindowOsrGtk*)’:
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:1633:10: error: ‘GDK_SCROLL_SMOOTH’ was not declared in this scope
     case GDK_SCROLL_SMOOTH:
          ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc: At global scope:
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:1654:42: error: ‘GdkEventTouch’ has not been declared
                                          GdkEventTouch* event,
                                          ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc: In static member function ‘static gboolean client::BrowserWindowOsrGtk::TouchEvent(GtkWidget*, int*, client::BrowserWindowOsrGtk*)’:
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:1670:18: error: request for member ‘type’ in ‘* event’, which is of non-class type ‘int’
   switch (event->type) {
                  ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:1671:10: error: ‘GDK_TOUCH_BEGIN’ was not declared in this scope
     case GDK_TOUCH_BEGIN:
          ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:1674:10: error: ‘GDK_TOUCH_UPDATE’ was not declared in this scope
     case GDK_TOUCH_UPDATE:
          ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:1677:10: error: ‘GDK_TOUCH_END’ was not declared in this scope
     case GDK_TOUCH_END:
          ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:1684:26: error: request for member ‘x’ in ‘* event’, which is of non-class type ‘int’
   touch_event.x = event->x;
                          ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:1685:26: error: request for member ‘y’ in ‘* event’, which is of non-class type ‘int’
   touch_event.y = event->y;
                          ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc:1691:55: error: request for member ‘state’ in ‘* event’, which is of non-class type ‘int’
   touch_event.modifiers = GetCefStateModifiers(event->state);
                                                       ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-undefined-var-template’ [-Werror]
cc1plus: all warnings being treated as errors
linux/CMakeFiles/MyApp.dir/build.make:803: recipe for target 'linux/CMakeFiles/MyApp.dir/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc.o' failed
make[3]: *** [linux/CMakeFiles/MyApp.dir/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/browser_window_osr_gtk.cc.o] Error 1
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/print_handler_gtk.cc: In member function ‘bool client::ClientPrintHandlerGtk::PrintHandler::OnPrintJob(const CefString&, const CefString&, CefRefPtr<CefPrintJobCallback>)’:
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/print_handler_gtk.cc:460:66: error: invalid conversion from ‘void (*)(GtkPrintJob*, void*, const GError*) {aka void (*)(_GtkPrintJob*, void*, const _GError*)}’ to ‘GtkPrintJobCompleteFunc {aka void (*)(_GtkPrintJob*, void*, _GError*)}’ [-fpermissive]
     gtk_print_job_send(print_job, OnJobCompletedThunk, this, NULL);
                                                                  ^
In file included from /usr/include/gtk-unix-print-2.0/gtk/gtkunixprint.h:26:0,
                 from /tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/print_handler_gtk.cc:11:
/usr/include/gtk-unix-print-2.0/gtk/gtkprintjob.h:106:26: note:   initializing argument 2 of ‘void gtk_print_job_send(GtkPrintJob*, GtkPrintJobCompleteFunc, gpointer, GDestroyNotify)’
 void                     gtk_print_job_send                   (GtkPrintJob              *job,
                          ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/print_handler_gtk.cc: In member function ‘virtual void client::ClientPrintHandlerGtk::OnPrintStart(CefRefPtr<CefBrowser>)’:
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/print_handler_gtk.cc:583:20: error: ‘make_unique’ is not a member of ‘std’
   print_handler_ = std::make_unique<PrintHandler>(browser);
                    ^
/tmp/workspace/linux/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/print_handler_gtk.cc:583:49: error: expected primary-expression before ‘>’ token
   print_handler_ = std::make_unique<PrintHandler>(browser);
                                                 ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-undefined-var-template’ [-Werror]
cc1plus: all warnings being treated as errors
linux/CMakeFiles/MyApp.dir/build.make:845: recipe for target 'linux/CMakeFiles/MyApp.dir/tmp/cef_binary_90.2.10+g9f05dc2+chromium-90.0.4430.51_linux64/tests/cefclient/browser/print_handler_gtk.cc.o' failed
leeroy
Techie
 
Posts: 48
Joined: Mon Jan 06, 2020 6:27 pm

Re: CEF - 4430 - Ubuntu 16.04 - undeclared GDK/GTK Objects

Postby magreenblatt » Fri Apr 09, 2021 2:10 pm

Are you using a CEF binary distribution that you downloaded? Do you have GTK3 packages installed?
magreenblatt
Site Admin
 
Posts: 10858
Joined: Fri May 29, 2009 6:57 pm

Re: CEF - 4430 - Ubuntu 16.04 - undeclared GDK/GTK Objects

Postby leeroy » Fri Apr 09, 2021 2:47 pm

Goodness, thanks @magreenblatt. Also just caught this communication in this commit https://bitbucket.org/chromiumembedded/ ... 0ac1b50972

Going to change a few things with our build box and report back. Thanks again!
leeroy
Techie
 
Posts: 48
Joined: Mon Jan 06, 2020 6:27 pm

Re: CEF - 4430 - Ubuntu 16.04 - undeclared GDK/GTK Objects

Postby leeroy » Fri Apr 09, 2021 5:52 pm

Again, thanks for the help! GTK3 was missing. I assumed that was on our build box and it wasn't.

The only other issue was we had to bump C++ standard to 14, from 11, to get make_unique. I don't believe there was anything specifically keeping us at 11, so this should be fine, this application has a fair amount of history I'm trying to wrap my head around.
leeroy
Techie
 
Posts: 48
Joined: Mon Jan 06, 2020 6:27 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 18 guests