fltk-1.4 build error in Fl_WinAPI_System_Driver.cxx with 32-bit mingw
imacarthur
Apr 20, 2023
All,
Was just checking the logs for my builds on WIn32/mingw and my 32-bit builds of fltk-1.4 are both (where "both" here means cmake and autoconf builds) have failed in WinAPI/Fl_WinAPI_System_Driver.cxx.
The cmake builds gives:
[ 34%] Building CXX object src/CMakeFiles/fltk.dir/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx.obj d:/Support/fltk-1.4/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx: In member function 'virtual char* Fl_WinAPI_System_Driver::preference_rootnode(Fl_Preferences*, Fl_Preferences::Root, const char*, const c har*)': d:/Support/fltk-1.4/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx:863:26: error: 'SHGFP_TYPE_CURRENT' was not declared in this scope SHGFP_TYPE_CURRENT, // dwFlags: use current, potentially redirected path ^~~~~~~~~~~~~~~~~~ make[2]: *** [src/CMakeFiles/fltk.dir/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx.obj] Error 1 make[1]: *** [src/CMakeFiles/fltk.dir/all] Error 2 make: *** [all] Error 2
And the "configure" build gives:
Compiling drivers/WinAPI/Fl_WinAPI_System_Driver.cxx... drivers/WinAPI/Fl_WinAPI_System_Driver.cxx: In member function 'virtual char* Fl_WinAPI_System_Driver::preference_rootnode(Fl_Preferences*, Fl_Preferences::Root, const char*, const char*)': drivers/WinAPI/Fl_WinAPI_System_Driver.cxx:863:26: error: 'SHGFP_TYPE_CURRENT' was not declared in this scope SHGFP_TYPE_CURRENT, // dwFlags: use current, potentially redirected path ^~~~~~~~~~~~~~~~~~ make[1]: *** [drivers/WinAPI/Fl_WinAPI_System_Driver.o] Error 1
Note that my mingw 64-bit builds all seem to be fine.
The crux seems to be the that the SHGFP_TYPE_CURRENT enum in the shlobj.h header file is protected by a compile time guard of:
#if (_WIN32_IE >= 0x0500)
....
But the 32-bit mingw toolchain seems not to be setting many (any?) of the many and varied MS version macros, and certainly does not appear to be setting _WIN32_IE to anything useful, so the code fails to compile...
The wingw64 tools do seem to be setting the version macros to useful values, as do the MSVC tools, so they do not exhibit this failure.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.