Environment variables in VC

 
Home Research Classes

Environment variables in VC++ are pretty simple to do. First, create a .bat file that defines the environment variables you require. At the very end of the bat file, add the command msdev to start the IDE. The IDE will no start with the correct environment variables defined. You can use these during the build (using the $() directive), or even while debugging or running a problem.

Other Stuff

  • You can use environment variables in your builds by specifying them in the Settings dialog box. For example, for include directories for the C++ compiler, you can specify $(D0_ROOT) if D0_ROOT has been defined to point to a directory. MSVC++ will then search there when looking for header files.

Gotta!

  • The msdev command doesn't work. When you first installed MSVC++ you were asked if environment variables should be registered. It is very likely that you said no at this point. Check your PATH environment variable. If the path isn't there, you'll have to add it by hand.