I build wxWidgets and/or my application using:
I compiled wxQt of wxWidgets-3.2.9 but I got this error during process:
src/generic/graphicc.cpp.o: in function `wxCairoContext::OffsetHelper::OffsetHelper(bool, _cairo*, wxGraphicsPen const&)':
src/generic/graphicc.cpp:1971:(.text+0x1d12): undefined reference to `cairo_surface_get_device_scale'
ld: /usr/src/debug/wxWidgets_3.2-3.2.9-1/src/generic/graphicc.cpp:1971:(.text+0x20e2): undefined reference to `cairo_surface_get_device_scale'
ld: /usr/src/debug/wxWidgets_3.2-3.2.9-1/src/generic/graphicc.cpp:1971:(.text+0x23a2): undefined reference to `cairo_surface_get_device_scale'
ld: libs/core/CMakeFiles/wxcore.dir/__/__/__/__/src/generic/graphicc.cpp.o: in function `wxCairoPenData::Apply(wxGraphicsContext*)':
src/generic/graphicc.cpp:1040:(.text+0x30fa): undefined reference to `cairo_surface_get_device_scale'
collect2: error: ld returned 1 exit status
I fixed the error with this tiny patch:
--- wxWidgets-3.2.9.old\src\common\cairo.cpp Sun Dec 07 23:59:42 2025
+++ wxWidgets-3.2.9\src\common\cairo.cpp Thu Feb 19 12:06:31 2026
@@ -186,7 +186,9 @@
m( cairo_user_to_device_distance, \
(cairo_t* cr, double *dx, double* dy), (cr, dx, dy) ) \
m( cairo_surface_mark_dirty, \
- (cairo_surface_t* surface), (surface))
+ (cairo_surface_t* surface), (surface)) \
+ m( cairo_surface_get_device_scale, \
+ (cairo_surface_t *surface, double *x_scale, double *y_scale), (surface, x_scale, y_scale))
#ifdef __WXMAC__
#define wxCAIRO_PLATFORM_METHODS(m) \
I wanted to contribute this patch as a PR, but I have not understood how to contribute it for 3.2.9.
Thank you very much.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
To create a PR against 3.2 you just need to pick "3.2" branch as "target" when opening it in the GitHub web UI.
I'm not sure why is this needed only for 3.2, however: cairo_surface_get_device_scale() seems to be used in master too?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I'm not sure why is this needed only for 3.2, however:
cairo_surface_get_device_scale()seems to be used in master too?
I also compiled version 3.3.1 but this error didn't happen, so I didn't check if this function is also used by sources into the master branch.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
wx 3.2.x uses cairo renderer by default under linux and this has changed in wx 3.3 which uses its own implementation
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()