Le 04/08/2016 à 10:19, Enrico Forestieri a écrit :
This does not compile with mingw (g++ 4.9.2): ../../src/graphics/PreviewLoader.cpp:101:4: error: ‘call_once’ was not declared in this scope }); ^
Finding infos about this was complicated because mingw does not appear to be very well documented. Also I did not find instructions for cross-compiling with Mingw using Ubuntu/Debian's mingw-w64 packages in the INSTALL files (despite there being two entries for mingw). I would be very curious to know how you do it, independently (useful for instance for being able to test on Windows ourselves). But I think I now understand what is going on. There seems to be two incompatible implementations of threads for mingw on windows: pthreads and win32. The definition of call_once in <mutex> is guarded by _GLIBCXX_HAS_GTHREADS, which, if I understand correctly, means it is only available with pthreads. Pthreads appears to be a heavier abstraction layer but is more compliant towards C++. Actually, it seems that the win32 threads make no effort at implementing the <thread> and <mutex> headers. It looks to me that there is a choice to make, to support compilation with pthreads instead of win32 threads, this being a cross-platform solution. * Can you manage to make it work by enabling pthreads? * If so, are LyX devs ready to officially deny support for mingw + win32 threads? In any case thank you for testing this cross-compilation with mingw since this is surely something that will help.