# sdl12-compat: testgl.c has to link against OpenGL32.lib on Windows. (3ad12)

**URL:** <https://discourse.libsdl.org/t/sdl12-compat-testgl-c-has-to-link-against-opengl32-lib-on-windows-3ad12/31710>\
**Category:** SDL Commits\
**Created:** [June 2, 2021, 2:28am UTC](https://discourse.libsdl.org/t/sdl12-compat-testgl-c-has-to-link-against-opengl32-lib-on-windows-3ad12/31710 "2021-06-02T02:28:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [June 2, 2021, 2:28am UTC](https://discourse.libsdl.org/t/sdl12-compat-testgl-c-has-to-link-against-opengl32-lib-on-windows-3ad12/31710/1 "2021-06-02T02:28:02Z")

</div>

> <https://github.com/libsdl-org/sdl12-compat/commit/3ad12eed638f4e2d3dc0de88f4f39c44ada347b7>

```diff
From 3ad12eed638f4e2d3dc0de88f4f39c44ada347b7 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Tue, 1 Jun 2021 21:53:16 -0400
Subject: [PATCH] testgl.c has to link against OpenGL32.lib on Windows.

---
 CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f5ef689..515c0cd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -139,6 +139,8 @@ if(SDL12TESTS)
     if(APPLE)
         target_link_libraries(testgl "-framework OpenGL")
         set_target_properties(testgl PROPERTIES COMPILE_DEFINITIONS "GL_SILENCE_DEPRECATION=1")
+ elseif(WIN32)
+ target_link_libraries(testgl "OpenGL32")
     else()
         target_link_libraries(testgl "GL")
     endif()

```
