Building REST plugin on Windows

I tried building the REST plugin on Windows, before making any code changes. I set up MSYS2 MINGW32, used instructions in BUILDING.md:

pacman -Sy mingw-w64-i686-toolchain mingw-w64-i686-cmake mingw-w64-i686-qt5 mingw-w64-i686-openssl mingw-w64-i686-sqlite3
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/mingw32/lib/cmake -B build
cmake --build build

This works nicely and produces de_rest_plugin.dll in build directory.

However, copying this to plugins folder, deCONZ fails to load the library without any message. Replacing the original .dll with the newly built one makes the REST plugin disappear from plugins menu, and the API certainly doesn’t work.

Clicking Help|About in deCONZ shows it’s built on GCC 11.3.0. I started from scratch again, reinstalling MSYS, installing old packages for GCC 11.3, and then building again. Same result: library isn’t loaded.

Does anyone have success developing on Windows?

I gave up on Windows and set up Ubuntu instead. I experienced major trouble building it with cmake, perhaps due to particulars of my environment. As I was about to throw the towel, I tried qmake, and it worked instantly. It’s marked as deprecated option soon to be removed. But then I notice, there’s a recent commit “Fix qmake build on Win32”. I never tried it, but this suggests, qmake might work on Windows, even though it’s not explicitly stated in the doc. This might be a clue that others are using qmake. Maybe it produces a working binary. Let’s consider it a hint for anyone who reads this later.

@manup