My projects need to define WIN32_LEAN_AND_MEAN. Unfortunately, they receive many compilation warnings due to macro redefinition in the following Boost headers (1.34.1). boost/iostreams/detail/system_failure.hpp boost/spirit/iterator/impl/file_iterator.ipp I understand that I can avoid the need to define WIN32_LEAN_AND_MEAN by ensuring that Boost headers are always included prior to <windows.h>. I do not like the idea of include order dependencies, as I am certain that I will come back to bite me down the road. Another option would be to turn the particular warning off; however, I would rather not do this. Would it be prudent to patch the Boost headers to only define WIN32_LEAN_AND_MEAN if it is not already defined? If not, is there another solution that I am overlooking. Thanks, Justin
I have the same problem and any suggestions on how to solve this would be much appreciated. Currently I'm wrapping all boost includes that cause the problem this like: #pragma warning(push) #pragma warning(disable: 4005) #include <boost/spirit.hpp> #include <boost/spirit/phoenix.hpp> #pragma warning(pop) But it's not pretty. // Anders S On 8/3/07, KSpam <keesling_spam@cox.net> wrote:
My projects need to define WIN32_LEAN_AND_MEAN. Unfortunately, they receive many compilation warnings due to macro redefinition in the following Boost headers (1.34.1).
boost/iostreams/detail/system_failure.hpp boost/spirit/iterator/impl/file_iterator.ipp
I understand that I can avoid the need to define WIN32_LEAN_AND_MEAN by ensuring that Boost headers are always included prior to <windows.h>. I do not like the idea of include order dependencies, as I am certain that I will come back to bite me down the road.
Another option would be to turn the particular warning off; however, I would rather not do this.
Would it be prudent to patch the Boost headers to only define WIN32_LEAN_AND_MEAN if it is not already defined? If not, is there another solution that I am overlooking.
Thanks, Justin _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Would it be prudent to patch the Boost headers to only define WIN32_LEAN_AND_MEAN if it is not already defined? If not, is there another solution that I am overlooking.
Ok, I dropped WIN32_LEAN_AND_MEAN from Spirit. I discussed it with Hartmut and neither of us know where that came from. Probably a pre-boost artifact. Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
Great! Thank you for your quick resolution of this problem. I hope the remaining defines in other library headers also can be removed. // Anders On 8/4/07, Joel de Guzman <joel@boost-consulting.com> wrote:
Would it be prudent to patch the Boost headers to only define WIN32_LEAN_AND_MEAN if it is not already defined? If not, is there another solution that I am overlooking.
Ok, I dropped WIN32_LEAN_AND_MEAN from Spirit. I discussed it with Hartmut and neither of us know where that came from. Probably a pre-boost artifact.
Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Anders Sundman
-
Joel de Guzman
-
KSpam