# GLFW fails to use WGL system-wide when I have specific second monitor connected

**URL:** <https://discourse.glfw.org/t/glfw-fails-to-use-wgl-system-wide-when-i-have-specific-second-monitor-connected/2633>\
**Category:** support\
**Created:** [May 15, 2024, 8:54am UTC](https://discourse.glfw.org/t/glfw-fails-to-use-wgl-system-wide-when-i-have-specific-second-monitor-connected/2633 "2024-05-15T08:54:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lombeelo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/lombeelo/32/913_2.png) [@Lombeelo](https://discourse.glfw.org/u/Lombeelo)\
**Post date:** [May 15, 2024, 8:54am UTC](https://discourse.glfw.org/t/glfw-fails-to-use-wgl-system-wide-when-i-have-specific-second-monitor-connected/2633/1 "2024-05-15T08:54:00Z")

</div>

As I was developing my application using glfw, it stopped starting with those messages:

GLFW Error 65544: WGL: Failed to make context current  
GLFW Error 65543: WGL: A forward compatible OpenGL context requested but WGL\_ARB\_create\_context is unavailable  
GLFW Error 65544: WGL: Failed to clear current context

I was using precompiled library packed with ImGui. GLFW crashed in glfwCreateWindow().

So… I checked the source code of GLFW for any hints and got nothing. Then i tried to open The Binding of Isaac: Repentance, wich also uses GLFW, and it silently crashes and leaves a crash dump  
[isacc crash minidump](https://github.com/glfw/glfw/files/15313453/isaacv1.7.9b.J835-20240514-225417-22520-22524.dmp)

When I disconnect my monitor, everything works fine.

Edit: forgot to mention that the failing function in isaac dump was WglMakeCurrent(). So, when i called GetLastError() in my application (with hope there is the same problem) it returned ERROR\_INVALID\_HANDLE(6)

Specs:  
Laptop: HP ProBook 445 G7  
CPU: AMD 4500U  
Graphics: Integrated  
Display: LG D2343 (connected via HDMI)  
OS: Windows 10 22H2  
RAM: 16Gb DDR4

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [May 15, 2024, 9:27am UTC](https://discourse.glfw.org/t/glfw-fails-to-use-wgl-system-wide-when-i-have-specific-second-monitor-connected/2633/2 "2024-05-15T09:27:05Z")

</div>

HI @Lombeelo, welcome the GFLW forum,

That is very odd, I’ve not seen this behaviour before simply due to connecting a monitor.

`WglMakeCurrent` is a win32 function, so this failing is really low level and there’s not much GLFW can do, unless somehow GLFW has set up the context incorrectly, though I would have expected an earlier error for that.

1. Could you try updating drivers in case this might be the issue?
2. Do you have any other OpenGL programs which do not use GLFW which work when the monitor is attached?
3. I am supposing you have 2 monitors (laptop+external) attached with both displaying. Which is the primary monitor in this case and does changing that change the issue?
4. How exactly do you launch + observe the issue the application?
5. Could you run DXDiag and check the Display tab Notes for any reported issues?

---

<div class="post-metadata">

**Author:** ![Lombeelo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/lombeelo/32/913_2.png) [@Lombeelo](https://discourse.glfw.org/u/Lombeelo)\
**Post date:** [May 15, 2024, 1:03pm UTC](https://discourse.glfw.org/t/glfw-fails-to-use-wgl-system-wide-when-i-have-specific-second-monitor-connected/2633/3 "2024-05-15T13:03:41Z")

</div>

Thank you for your reply. I tinkered with my computer a bit more and found out that deleting drivers for all displays + GPU in device manager then restarting helped me. I will write all other things you asked me just in case it will help make GLFW better.

1. When I tried deleting opengl32.dll I found out that steam was using it and was working totally fine
2. Yes I use exact setup, laptop display is primary
3. Isaac was launched from steam and immediatly crashed without any messages and minidump file was generated by the game itself. It’s attached in first post. Also I was launching my own application from Visual Studio 2022 wich compiled with precompiled GLFW library in ImGui repository [link (github.com)](https://github.com/ocornut/imgui/blob/master/examples/libs/glfw/lib-vc2010-64/glfw3.lib). Error message is in the first post
4. Checked it before fix - there were no issues.

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [May 15, 2024, 1:35pm UTC](https://discourse.glfw.org/t/glfw-fails-to-use-wgl-system-wide-when-i-have-specific-second-monitor-connected/2633/4 "2024-05-15T13:35:49Z")

</div>

> I tinkered with my computer a bit more and found out that deleting drivers for all displays + GPU in device manager then restarting helped me.

So you have resolved the issue completely?

> When I tried deleting opengl32.dll

I would not recommend deleting `opengl32.dll`, this is a system dll which comes with Windows. The actual OpenGL driver is installed with your GPU drivers.

---

<div class="post-metadata">

**Author:** ![Lombeelo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/lombeelo/32/913_2.png) [@Lombeelo](https://discourse.glfw.org/u/Lombeelo)\
**Post date:** [May 15, 2024, 2:44pm UTC](https://discourse.glfw.org/t/glfw-fails-to-use-wgl-system-wide-when-i-have-specific-second-monitor-connected/2633/5 "2024-05-15T14:44:09Z")

</div>

Yes, issue was resolved.
