4.2.3 and "undefined symbol: cairo_gl_surface_get_width"

Hi all,

I compiled from source the last wxPython 4.2.3 with success.

But I get this error :

(env4.2.2-py3.11) [redge@openmandriva-x8664 env4.2.2-py3.11]$ python
Python 3.11.11 (main, Feb 11 2025, 19:35:10) [Clang 19.1.7 (/builddir/build/BUILD/llvm-19.1.7-build/llvm-project-llvmorg-19.1 on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> import wx.html2 as webview
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/redge/Development/GestConsoPhoenix4.2.2--1.4.4/env4.2.2-py3.11/lib64/python3.11/site-packages/wx/html2.py", line 15, in <module>
    from ._html2 import *
ImportError: /usr/lib64/libwebkitgtk-3.0.so.0: undefined symbol: cairo_gl_surface_get_width
>>>

Any idea ?

Thanks in advance for your help.

I don’t understand this “warning” :

configure: WARNING: Disabling wxWebRequest because no backends are available

This is the build.log :

  checking what is the type of the fifth argument of getsockopt... socklen_t
  checking whether we have sockaddr_in6... yes
  configure: WARNING: Disabling wxWebRequest because no backends are available
  checking for linux/joystick.h... yes
  checking for XTST... yes
  checking for PRIVATE_FONTS... yes
  checking for python... /home/redge/Development/GestConsoPhoenix4.2.2--1.4.4/env4.2.2-py3.11/bin/python
  checking for WEBKIT... configure: WARNING: webkit2gtk-4.1 not found, falling back to webkit2gtk-4.0
  checking for WEBKIT... configure: WARNING: webkit2gtk-4.0 not found, falling back to webkitgtk
  checking for WEBKIT... yes

Is it a clue ?

Thanks.

The last time I built wxPython from source on Mint I had to install the libwebkit2gtk-4.1-dev package.

I have had yet the lib64webkit2gtk3.0 and its “devel” one package : but I had the issue.

So I apply your advice installing lib64webkit2gtk-4.1, then compile again :

  • the warning in the build.log was still here
  • but I can execute my application now :slight_smile:

Problem solved, thank you Richard, you are right.
:v:

@Zylyco the warning about wxWebRequest is not related to WebKit. wxWebRequest requires a library such as libcurl for fetching data via HTTP. To resolve that warning, you’ll want to install the libcurl development package for your distribution.

@swt2c thank you for this information :slight_smile:

Surely, the warning was a false flag for my issue I suppose.
The fact is after installing lib64webkit2gtk-4.1 and its development packages, the problem disappeared.

Anyway, I installed lib64curl and its development packages, and compile wxPython again.
And it turns out that the previous warning message vanished.
I did not noticed any malfunction in my software, certainly because I use HTML without external HTTP links : I use WebView for editing local web pages.
What do you think about my opinion ? Does it make any sense ?

Yes for your original problem (the undefined symbol error), installing lib64webkit2gtk-4.1 makes sense as a solution.