Best place for WIN32_LEAN_AND_MEAN?

Started by
3 comments, last by stodge 21 years, 2 months ago
What is the best place for WIN32_LEAN_AND_MEAN? Should it be in all header files, the main.cpp (i.e. main source file) or a pre-processor definition in the project settings in Visual Studio? The reason I''m asking is that my OpenGL/SDL program seems to be loading a lot of DLLs that it doesn''t need. So I was wondering if I could reduce the number of libraries/DLLs that were loaded by using WIN32_LEAN_AND_MEAN. Thanks
---------------------http://www.stodge.net
Advertisement
I''d say before including windows.h.
WIN32_LEAN_AND_MEAN has nothing to do with dll loading at runtime. nor does it have anything to do with lib references at build time. its only purpose is to "hopefully" decrease compile time since it''s used to not include certain headers which aren''t typically needed.
my post above assumes a use of WIN32_LEAN_AND_MEAN within the context of the VC++ 6.0 or previous IDE.
It''s true of any release.

WIN32_LEAN_AND_MEAN doesn''t affect what you link to. The linker is smart enough to remove references to DLLs which never get called (usually it only does it in Release mode, though there''s an option to turn it on in Debug or whatever).

If I had my way, I''d have all of you shot!

codeka.com - Just click it.

This topic is closed to new replies.

Advertisement