views:

125

answers:

2

Hello All,

I'd really appreciate some help or ideas on a very frustrating issue. In my experience it seems that any time I need to organize or update my solutions/projects, I realize how buggy and poor the program actually is. I always end up having to find a hack or run into a nasty trial by failure that forces me start from scratch at least once during the process.

Anyways, my issue is that I've been upgrading projects from 2005 to 2008 and the time has come to get 2010 up and running. For my older projects, I decided at one point to use System Environment Variables to set as my output directory.

For Example:

My Machine:
System->Advanced Settings->Environment Variables 3DSMAX_DEV_ROOT_32 = F:/Temp/Rampage/
My Project->General:
Output Directory = $(3DSMAX_DEV_ROOT_32)
My Project->Linker->General:
Output File = $(OutDir)MyPlugin.dll

This always worked for Visual Studio 2005 and 2008 and I still heavily depend on it. However, for 2010, it just won't work. I'd be surprised if I'm the only one who has dealt with this but I haven't seen anyone else run into it. Others have mentioned Project Environment Variables but I haven't seen anything on the system ones. Anyways, if you have any ideas how to make them work or know why they now seem to completely disregard them, I'd love to hear about it. To make matters worse, I know leading digits are usually a no-no, but my EV's have them and VS's EV's are not allowed to have them. I know of a way I can get around it but I'm on a team of developers and making this change would be a huge pain for everyone.

Thanks for taking the time to read.

Erik

+1  A: 

PATH is a pretty special environment variable - you shouldn't be using it to point to a temp directory for VS output.

Note that by default, VS doesn't use the following environment variables from your system env, instead overriding them with it's own:

  • PATH
  • INCLUDE
  • LIBPATH
  • LIB

If you do wnat VS to use your system variables for these, you need to start Visual Studio with the /useenv option:

devenv /useenv

But you still should use another variable than PATH - it's really pretty special. (I'm kind of surprised that setting System->Advanced Settings->Environment Variables Path = C:/Temp/ doesn't cause you all sort of other problems).

Michael Burr
I use a System Variable named TFS for this same reason with VS2010 and VS2008
Jon Ownbey
Wait you got them to work or you have the same problem? This definitely seems to be an issue with Visual Studio 2010.
A: 

This happened to me as well, which happened after a fresh install of Visual Studio 2010 or any of the libraries involved.

Of course, first check if the environment variables are set (and are correct). When I transferred from Visual Studio 2005 to 2010 I also transferred from Windows XP to Windows 7, and some programs are then installed in the 'Program Files (x86)' folder instead of the one without '(x86)'. Take a note of that as well!

When you right click on an include file which you know should reside in one of the paths set by environment variables and press 'open file', Visual Studio 2010 should give you a list of include directories where it looked in. When the environment variables are not read, this part is empty and shows maybe something simple like '/include' instead of 'C:/Program Files/YourProgram/include'.

My solution was rather simple, because after a restart of the computer it worked... Just try and see if this does it for you too. I think it has to do with the activation of environment variables, they are globally set on a reboot. So also if you change one, you need to reboot to make the change effective.

DoubleYou

related questions