Building latest master on Windows

I have been building my dt based on the master regularly “the old way”. I switched now to using UCRT, and my build failed.

FAILED: bin/CMakeFiles/lib_darktable_imageio_rawspeed.dir/common/imageio_rawspeed.cc.obj
C:\msys64\mingw64\bin\c++.exe [...] -c C:/msys64/home/lintujuh/darktable/src/common/imageio_rawspeed.cc
In file included from C:/msys64/home/lintujuh/darktable/src/common/colorspaces_inline_conversions.h:21,
                 from C:/msys64/home/lintujuh/darktable/src/common/iop_profile.h:22,
                 from C:/msys64/home/lintujuh/darktable/src/common/opencl.h:47,
                 from C:/msys64/home/lintujuh/darktable/src/develop/imageop.h:35,
                 from C:/msys64/home/lintujuh/darktable/src/common/imageio_rawspeed.cc:40:
C:/msys64/home/lintujuh/darktable/src/common/math.h: In function 'void downscale_vector(float*, float)':
C:/msys64/home/lintujuh/darktable/src/common/math.h:250:46: error: 'isnan' was not declared in this scope; did you mean 'std::isnan'?
  250 |   const int valid = (scaling > NORM_MIN) && !isnan(scaling);
      |                                              ^~~~~
      |                                              std::isnan
compilation terminated due to -Wfatal-errors.

I followed the new instructions in README.md. Is there still something missing from my environment?

I updated my MSYS environment before the change, and I have now gcc 12.2.

This is obviously not using the UCRT64 console and subsystem (which should be using binaries from C:\msys64\ucrt64).

Anyway, even when you fix this, there is currently a problem w/ the build due to some other problem…

I built few times today on Windows, using UCRT, without problems

I found my error. I had my old .bash_profile, where, according to the old instructions, I had added mingw64/bin as the first element in my $PATH . When I removed those lines, I managed to get further, until got the error you @kmilos refer to “undefined reference to `SDL_main’”.

I built yesterday and installed. The SDL had the error, but it finished building.

I managed also to build the version 262 successfully, but I have now issues with starting dt. If I start darktable from the desktop icon, or from the command prompt, darktable only flashes quickly the lighttable window, and then aborts with Invalid window handle. Running darktable with ‘-d all’ doesn’t provide any additional information, the only information is available in Windows event viewer.

If I start darktable (the same executable) from the UCRT terminal, or through gdb, everything works normally.

Any ideas, what could be the issue?

You might still have C:\msys64\mingw64 somewhere in your environment variables (PATH, CAMLIBS, IOLIBS…), or CAMLIBS/IOLIBS might be pointing to dt 4.0 installed in C:\Program Files\darktable\... (which has MINGW64 binaries)?

The UCRT64 terminal sets these up for you correctly for that session, that’s why it works.

That was an issue I had, but I’m still having the same problem even after fixing it. I have also deleted the build folder and recreated all. Any further ideas?

Does it work if you add C:\msys64\ucrt64\bin to your PATH instead?

Again, what are your CAMLIBS and IOLIBS when you’re not in the UCRT64 terminal?

The last nightly build (4.1.0+264~g083dcb2e9) works fine for another user when these are set correctly.

I’m busy during the weekend, I’ll check updating party on Sunday evening. CAMLIBS and IOLIBS point to the dt folder outside UCRT. I’ll try to delete all files from that folder, in case there some old files.

Finally it works. I rebooted my Windows, and rebuilt everything. Probably there were some traces of the mingw somewhere that required the reboot.