Window does not get created and terminates

my program compiles but always exits when checking if the window creation was successful this is for both debug and release builds.

I’m using visual studio 2022 and windows 11. generated GLFW with cmake and had to get the GLFW header files from the precompiled binaries. I have tried using the precompiled binaries and had the same issue. the linker input, include and library directories are correct.

okay problem solved I’ve had to have my amd driver disabled for a few months ( computer crashes every 10 minutes ) so have been using the Microsoft generic, enabling the amd driver fixed the issue. so unfortunately cant use GLFW.

You could try using mesa llvmpipe software renderer. It obviously won’t be as fast as GPU hardware, but it will be way more functional than default Microsoft generic GL driver.

You can build it yourself, or you can download precompiled binary, for example, from here: Mesa3D For Windows - Federico Dossena
Place opengl32.dll from archive next to your .exe file and it should use software renderer.

The version in that link is quite old. If you want to build latest binary, see my build batch file here: builds statically linked mesa opengl32.dll with llvmpipe using Visual Studio (make sure to download mesa.patch file too!!!) · GitHub
It will build latest mesa code (currently at 21.3.0-rc1 version) that allows to use OpenGL version 4.5 for compatibility and core profiles.

I would also note that if your computer is crashing every 10 minutes with the AMD driver then it might be worthwhile investigating that and fixing it as this is highly unusual.

I have had a lot of success in using Warnardsoft’s Display Driver Uninstaller from uninstalling driver installs which failed (as a gamedev we sometimes have to switch GPUs a lot). Make sure to read the tutorial.

If uninstalling and installing a recent fails to resolve the problem it could be that some other software is causing the issue - I’ve seen everything from supposedly benign utilities to viruses and Bitcoin miners installing hooks into GPU drivers causing weird issues. There are a variety of free tools to help clean your system but a fresh install might be the best approach if you’re seeing this level of issues though you might first want to check your hardware isn’t the issue (though this can also take a lot of time).

Finally you could have a hardware issue - random frequent crashes are sometimes due to PSU power being too low, RAM problems etc.

thanks mesa llvmpipe worked.