Executing application fails with code 0xc0000135 during build

I have a rather complicated build setup:
First, a command line executable (ommpfritt-cli) is built, then it is executed in order to generate some icons, which are then bundled into the actual application (ommpfritt).

The problem is, that on windows, execution of ommpfritt-cli fails with code 0xc0000135 (apparently a DLL is missing).
I have the same setup on my local windows (MinGW) machine (same packages installed, same dlls in the build directory), and it works.
It also works on travis with ubuntu.

I don’t know how to debug this, please advice!

See diagnosis steps in this post:

7 posts were split to a new topic: Opengl32.dll is missing