From 333661a3bc468cc3613fc510b47fb4c0c135839e Mon Sep 17 00:00:00 2001 From: Damyan Pepper Date: Fri, 19 Dec 2025 18:29:01 -0800 Subject: [PATCH] Win: always link with opengl32.lib winapi explicitly doesn't link with opengl32.lib on all supported Windows platforms (aarch64 and thumbv7a). Presumably this dates back to when these Windows platforms didn't support OpenGL. Since that's no longer the case, and baseview won't be able to link successfully if the opengl feature is enabled and opengl32.lib isn't linked, this change makes it explicitly link opengl32.lib. --- src/gl/win.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gl/win.rs b/src/gl/win.rs index 097eb092..c886880f 100644 --- a/src/gl/win.rs +++ b/src/gl/win.rs @@ -20,6 +20,12 @@ use winapi::um::winuser::{ use super::{GlConfig, GlError, Profile}; +// winapi doesn't link with opengl32.lib on all supported Windows platforms, +// Since winapi is no longer being maintained this is unlikely to ever be fixed, +// so we need to link it manually. +#[link(name = "opengl32")] +extern "system" {} + // See https://www.khronos.org/registry/OpenGL/extensions/ARB/WGL_ARB_create_context.txt type WglCreateContextAttribsARB = extern "system" fn(HDC, HGLRC, *const i32) -> HGLRC;