Defining Macro's using bjam or "config/user.hpp".
I have just downloaded Boost 1.35.0 for use with MSVC9 (Microsoft Visual Studio 9.0). As some of you may be aware, Microsoft has added some features which are a little troublesome to work around with Boost. They are controlled by the following macros (and perhaps others I've missed): - _CRT_SECURE_NO_WARNINGS - _SCL_SECURE_NO_WARNINGS - _SECURE_SCL I must say, I find building Boost a pain at the best of times, but I can't seem to find a way to define these macros on bjam's command line. Putting the changes in "boost/config/user.hpp" doesn't work and errors like the following result: basic_iserializer.cpp .\boost/config/user.hpp(128) : warning C4005: '_SECURE_SCL' : macro redefinition C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\yvals.h(124) : see previous definition of '_SECURE_SCL' The reason is in this instance is that "basic_iserializer.cpp" contains the following at the top: #include <cassert> #include <cstdlib> // NULL #include <boost/config.hpp> Note that <cassert> is included before <boost/config.hpp>: it's already too late then as including <cassert> results in the macros being defined. I have searched the web and found many "solutions", but I couldn't get any of them to work. Any help would be much appreciated. Steve
Stephen Hewitt wrote:
I have just downloaded Boost 1.35.0 for use with MSVC9 (Microsoft Visual Studio 9.0). As some of you may be aware, Microsoft has added some features which are a little troublesome to work around with Boost. They are controlled by the following macros (and perhaps others I've missed):
- _CRT_SECURE_NO_WARNINGS
- _SCL_SECURE_NO_WARNINGS
- _SECURE_SCL
Try something like: bjam msvc define=_CRT_SECURE_NO_WARNINGS=0 define=_SCL_SECURE_NO_WARNINGS=0 define=_SECURE_SCL=0 HTH, John.
participants (2)
-
John Maddock
-
Stephen Hewitt