From bf09d7832f405cc62788bbdb8a431673b2d9464a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bas=20Magr=C3=A9?= Date: Tue, 3 Nov 2026 18:33:52 +0100 Subject: [PATCH] engine, gameui: use system jpeglib headers on Linux sys_getmodes.cpp and OptionsSubMultiplayer.cpp included the bundled libjpeg v8 header (public/jpeglib), while on Linux the system libjpeg(-turbo) is linked (API 62). The `jpeg` console command aborted with "Wrong JPEG library version: library is 62, caller expects 80". Include like common/imageutils.cpp already does; Windows and Android keep the bundled header. Co-Authored-By: Claude --- engine/sys_getmodes.cpp | 7 +++++++ gameui/OptionsSubMultiplayer.cpp | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/engine/sys_getmodes.cpp b/engine/sys_getmodes.cpp index 43dce4d0ab..bad3914c0f 100644 --- a/engine/sys_getmodes.cpp +++ b/engine/sys_getmodes.cpp @@ -41,7 +41,14 @@ typedef void *HDC; #include "materialsystem/materialsystem_config.h" #include "materialsystem/itexture.h" #include "materialsystem/imaterialsystemhardwareconfig.h" +#if defined(_WIN32) || defined(ANDROID) #include "jpeglib/jpeglib.h" +#else +// Use the system libjpeg headers: we link against the system libjpeg(-turbo), whose ABI +// (JPEG_LIB_VERSION 62) differs from the bundled v8 headers in public/jpeglib. +#include +#include +#endif #include "vgui/ISurface.h" #include "vgui_controls/Controls.h" #include "gl_shader.h" diff --git a/gameui/OptionsSubMultiplayer.cpp b/gameui/OptionsSubMultiplayer.cpp index 3a262d0354..809f9bf610 100644 --- a/gameui/OptionsSubMultiplayer.cpp +++ b/gameui/OptionsSubMultiplayer.cpp @@ -50,7 +50,13 @@ // use the JPEGLIB_USE_STDIO define so that we can read in jpeg's from outside the game directory tree. For Spray Import. #define JPEGLIB_USE_STDIO +#if defined(_WIN32) || defined(ANDROID) #include "jpeglib/jpeglib.h" +#else +// System libjpeg headers, matching the linked system libjpeg(-turbo) (see engine/sys_getmodes.cpp). +#include +#include +#endif #undef JPEGLIB_USE_STDIO #include