#213 FreeImagePlus.h includes windows.h

None
pending
None
5
2016-03-20
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é

     
  • Hervé Drolon

    Hervé Drolon - 2016-03-20
    • status: open --> pending
    • assigned_to: Hervé Drolon
    • Group: -->
     
  • Hervé Drolon

    Hervé Drolon - 2016-03-20

    <windows.h> is included using _WIN32 macro, so that it doesn't cause any problem under Linux OS.

     

Log in to post a comment.