The LoadLibrary failed with error 126 message is an error that typically occurs when you launch a game or OpenGL software. Causes can range from a faulty driver to having multiple graphics adapters on your PC. There are a few fixes to resolve error 126, as explained in this guide.
Good to know: Steam games won’t launch? Learn what to do.
Basic Troubleshooting
To begin with, it’s worth trying a few generic fixes, as they might be all you need to get the problem fixed.
- Update graphics driver – faulty and outdated drivers are a common cause that can trigger error 126. First, try updating your graphics driver(s) by opening the Device Manager and double-clicking Display adapters to see your driver(s.) Right-click on a driver, select Update driver, and follow the prompts to update.
- Reinstall graphics driver – if your driver is already up to date, but you still suspect an issue, consider reinstalling the driver. First, right-click on the driver in Device Manager, and select Uninstall driver. Click on Action at the top of Device Manager, and select Scan for hardware changes to reinstall the driver.
- Roll-back driver – if the issue appeared after a Windows update or after a manual driver update, roll back the graphics driver. Rolling back is essentially uninstalling the driver update and reinstalling the previous version of the driver.
- Run an SFC scan – the error can also be caused by corrupted system files, and Windows has a built-in utility called the System File Checker to help in such situations. Running an SFC scan can identify and fix problems caused by corrupted or missing system files.
Tip: dealing with game stuttering on your Windows PC? Check out our list of fixes to improve the situation.
1. Run the App as an Administrator
The game or app you’re trying to launch might require admin privileges. Running the app with admin rights is generally the first line of defense, as it doesn’t involve tinkering with any system settings.
You can run an app as an admin by right-clicking on the icon and selecting Run as administrator.
If that works, you can set the app to always run with admin privileges. Search for the app in the Start menu, and select Open file location from the right pane. When File Explorer opens, find the app shortcut here, right-click it, and select Show more options -> Properties.
Switch to the Shortcut tab, click Advanced, and check the Run as administrator option. Click OK to save and exit.
The next time you run the app, it will automatically launch with admin privileges.
2. Disable Secondary Graphics Adapters
Having multiple graphics adapters active can potentially cause error 126. Disabling all but one graphics adapter may resolve the problem.
Right-click on the Start menu, and select Device Manager. Under Display adapters, right-click on the adapter you want to disable, and click Disable device. Select Yes to confirm when you see the prompt.
Relaunch the app or game when you’re done.
Tip: want to display FPS while gaming in Windows? These are the best tools for that.
3. Select a Main Display
Having multiple monitors connected to your PC could be another reason you’re seeing the error pop up. The game or app may not be able to figure out the correct display to show its content, resulting in the error 126.
Try disconnecting all displays, except the one you want to use as your primary display, and see whether that resolves the problem.
If disconnecting the monitors seems like a hassle, change your primary monitor via Windows Settings.
Open the Settings app by pressing Win + I. Navigate to System -> Display, and select your primary monitor. Expand the Multiple displays section, and enable the Make this my main display option.
Once you see all but the primary display, try relaunching the app or game.
Tip: learn how to troubleshoot when your multi-monitor setup is not working as intended.
4. Copy Atio6axx.dl to System32
If you use an AMD graphics card, you may be able to fix error 126 by copying the Atio6axx.dll file to the System32 folder. The DLL file is part of the AMD OpenGL driver program developed by AMD. Apps and games may need the Atio6axx.dll file to work properly. If there’s a problem with it, you could encounter errors like error 126.
Use the command line to copy the DLL file over to System32. Start by searching for the Command Prompt in the Start menu, then click Run as administrator on the right.
Once the window opens, copy and paste the following command, then press Enter:
cd \Windows\system32
When you reach the System32 directory, execute the following command:
copy atio6axx.dll .dll
Exit the Command Prompt once you’re done, and reboot your laptop.
FYI: learn how to overclock RAM using the AMD Ryzen Master.
5. Remove AMD Software
Some users have reported solving error 126 by uninstalling AMD Software (previously AMD Catalyst). If you use an AMD graphics card, uninstalling the AMD program could resolve the problem. You can remove the program from the Programs and Features section in the Control Panel – the process is the same as uninstalling any other Windows program.
6. Clean Boot Your PC
If none of these solutions have worked, consider that a program may be interfering and causing the issue. Performing a clean boot can help identify the culprit, as it starts your computer with just a few essential services.
Before you perform a clean boot, disable non-essential and third-party startup items by searching for “system configuration” in the Start menu and selecting the best match.
Select Selective startup under the General tab, and uncheck Load startup items.
Switch to the Services tab, check the box next to Hide all Microsoft services, then click Disable all to disable all non-essential services.
Go to the Startup tab, and select Open Task Manager. Disable all startup programs, then click OK.
Restart your computer to clean boot, and see whether the game or app works. If it does, start your computer with more programs until you identify the culprit, then uninstall it from your device.
Tip: should you invest in a gaming laptop? Check out our post to help make up your mind.
LoadLibrary Failed with Error 126, Fixed
Error 126 can quickly get on your nerves when you only have a small window of time to play your favorite game. Hopefully, one of the fixes in this guide will help remove the error and get back to gaming. Once you resolve the issue, you may want to learn a thing or two about optimizing your PC for gaming to improve your experience.
Image source: Pixabay. All screenshots by Arjun Ruparelia.
Our latest tutorials delivered straight to your inbox