FLTK logo

[fltk.coredev] fltk-1.4 build error in Fl_WinAPI_System_Driver.cxx with 32-bit mingw

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

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.

We probably need to do something like (untested):

#ifdef _WIN32
#  if !(defined _WIN32_IE) || (_WIN32_IE < 0x0500)
#      undef _WIN32_IE
#      define _WIN32_IE  0x0500
#  endif /* _WIN32_WINNT checks */
#endif /* _WIN32 */


At the top of Fl_WinAPI_System_Driver.cxx as a workaround for this?

--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/8fa7947b-5543-481b-bc49-b573003af457n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.