Using user-defined environment values in "Include Directories"

I'm currently working on a project from two different computers. Each one of them is set up differently. So, when I go from one computer to the other, Visual Studio's "Additional Include Directories" and "Additional Library Directories" data is incorrect. I've been dealing with it for a while now, changing the directories as I go, but I suddenly had a great idea: define an environment variable %VCLIBS% which leads the compiler to the appropriate folder (I use Dropbox and keep all my libraries there, so I have access to them at all times. Thus, I can't simply put them in the default library directory) in each computer. In one computer, I define it as one path, and on the other, something else. I do this once and never have to think of it again.

And it worked great. For "Additional Library Directories". However, for "Include Directories", not so much. I.e.
Additional Library Directories: "%VCLIBS%\glew-1.5.7\lib";"%VCLIBS%\glut-3.7.6-bin"

Additional Include Directories: "%VCLIBS%\glew-1.5.7\include\GL";"%VCLIBS%\glut-3.7.6-bin"

At first, I'd defined the variable incorrectly, so I'd immediately get a compile error since it couldn't find the .lib files. I then corrected it and it no longer complains about the .lib files, which tells me the variable is working well for them. However, I now get problems with the header files, the classic No such file or directory error which means you made a newbie error linking to your include directory. However, if I copy-paste the directory from VC (%VCLIBS%\glew-1.5.7\include\GL) and throw that onto Explorer, it opens up just fine, with glew.h in plain view. However, if I replace the environment variable with its value (E:\(...)\Libraries), it compiles.

Am I doing something wrong? Does VC++2008 not accept environment variables in some instances?

EDIT: P.S. I've already closed and opened VC again to refresh it's environment variables. That's how I got the .lib files to work.

Also, please note how for glut, the Include and Lib directories are exactly the same. However, while VC++ finds glut32.lib, it can't find glut.h.
Last edited on
Any help would be much appreciated.
Don't know about vs2008, but in vs2010 I use something like $(VCLIBS) just fine.
Yeah, I posted in the MSDN forums about this and they suggested that. It worked. No one could explain why %VCLIBS% worked in one but not the other, though.
Topic archived. No new replies allowed.