Setting environment variables in pre-build event and using in compilation step
问题 In Visual Studio 2003, I am trying to set an environment variable in the pre-build event that will then be used in the compilation step, but the value doesn't seem to be propagated. For example, if the pre-build event contains this (either directly or within a batch file): set MY_LIB_VERSION=1.0.0 and AdditionalIncludeDirectories has this: c:\path\to\library\my_lib_v$(MY_LIB_VERSION)\include then I would expect the compilation to work if the my_lib_v1.0.0 directory exists. But instead, I get