I struggled for two days straight to get my LZO Node module working on Windows. It kept on complaining about "A dynamic link library (DLL) initialization routine failed." when trying to use it in Electron on Windows. It turns out that this is due to a bug in Electron and Node. The funny thing is that there is a workaround implemented in the
prebuildify dependency I'm using, but I was just not using the latest version. Always check your dependency versions kids!
There was one more twist: It still wouldn't work on 32-bit Windows, resulting in a "Module not found" error when it's clearly in the right directory. It seems to have something to do with the avutil-56.dll I built, as using a prebuilt .dll works fine. I do need to build my own, as prebuilt ones are usually not LGPL licensed. So now I'm rebuilding FFmpeg for the umpteenth time, this time round using the ffmpeg-windows-build-helpers script to build LGPL-licensed 32-bit and 64-bit cross-compiled shared libraries:
./cross_compile_ffmpeg.sh --enable-gpl=n --build-ffmpeg-shared=y --compiler-flavors=multi