Re: [Boost-users] 1.49 header order conflicts on Windows

Lars Viklund:
Asio is "friendly" enough to define WIN32_LEAN_AND_MEAN for you, which pretty much breaks any other consumer of Windows.h.
I wasn't aware that that's a no-no and am doing the same thing. My code doesn't compile without the define so am wondering what can be done to help. I'm also having another problem on Windows https://groups.google.com/forum/?fromgroups#!topic/comp.lang.c++/Hpoi2pbQD74 Shalom, Brian Wood Ebenezer Enterprises http://webEbenezer.net

On Thu, Jun 14, 2012 at 04:16:08PM -0400, Brian Wood wrote:
Lars Viklund:
Asio is "friendly" enough to define WIN32_LEAN_AND_MEAN for you, which pretty much breaks any other consumer of Windows.h.
I wasn't aware that that's a no-no and am doing the same thing. My code doesn't compile without the define so am wondering what can be done to help.
Lean and mean is a historical artifact from the days where you might not need all of the things that Windows.h pulled in, and if you were sure that you didn't, you could define it to prevent the less used things like HDROP to be defined. Sadly, as the only documented way to get those definitions is to include Windows.h with the right flags, and you only get one shot at including a header in a TU, you're properly hosed if someone goes and defines/includes that before you get to, unless you have the ability to inhibit it. In pretty much every single GUI project I do, I eventually include Asio, which will promptly break everything, especially ATL. If your code doesn't build unless you define WIN32_LEAN_AND_MEAN, you should change your code to not collide with the parts of the Windows API that are hidden behind that guard. As for your other (removed) question, ask that in a separate thread, as it doesn't really have anything to do with the current topic. -- Lars Viklund | zao@acc.umu.se
participants (2)
-
Brian Wood
-
Lars Viklund