allegro_main-5.2.dll Error in Windows 10 and 11: Allegro application entry point

An Allegro program fails at launch before it creates its first window. If the first error mentions allegro_main-5.2.dll, record the exact wording and which operation triggers it. Begin with a known working sample so changes can be checked against a reference.
What allegro_main-5.2.dll does
The MSYS2 UCRT64 Windows manifest lists allegro_main-5.2.dll in its Allegro build. The Allegro project reference explains the associated software. Use the runtime packaged for your specific application and Windows architecture.
Identify the first failure
Check the first loader message and compare the executable and Allegro DLLs with the vendor’s packaged release. Record the app version and the first loader, feature or file message. Work on a copy of a project or asset while testing.
Restore the matching components
Repair or reinstall the complete application. For a build you maintain, match the Allegro main component to the runtime and startup configuration documented for that platform.
Start with the original publisher installer or the app’s approved distribution. Microsoft’s app repair instructions explain when Windows offers repair or reset. Back up your settings and project files before replacing or resetting an app. For portable packages, re-extract the full archive from the publisher. Keep modules and their dependencies from the same release and toolchain. Avoid standalone DLL download sites.
Verify the fix
Launch a known example from its normal entry point and confirm its main window appears. Restart the application and repeat the operation on the original input. If the error returns, give the earliest diagnostic and a small reproducible sample to the publisher.
For a related issue, see the allegro-5.2.dll troubleshooting guide. Browse the DLL Errors & Fixes Library for other Windows fixes.