#213 FreeImagePlus.h includes windows.h

open
nobody
None
5
2012-10-31
2012-05-24
Jonathan
No

Including windows.h causes several errors because of the stupid definitions inside of it. Thinks like std::max stop to work, because max is a Macro inside Windows.h. Though it is possible to undefine this macro, their are really lots of other common names overwritten by macros.
As far as I can see, the windows.h is only used for the fipWinImage class. The easiest solution would be to make this optional and only include windows.h, if this class is desired. But I think it should also be possible to provide this class without bringing all this stupid windows.h macros to the global namespace.

Discussion

  • Hervé Drolon
    Hervé Drolon
    2012-07-03

    Hi,

    Can you describe your environment (e.g. Linux / Windows, compiler, etc ...)

    Hervé