I have some libraries like Qt and OpenCV which are installed locally on several machines. The environment variables such as QTDIR and QMAKESPEC are user environment variables. Will these be stored seperately on each machine or are these variables now part of the user profile, i.e. a certain user will always have the same QTDIR on all machines?

  • Those libraries must be installed on each machine in order to run the software that requires them. It makes no sense those variables will exist on machines where the libraries are not installed. – Ramhound Dec 4 '14 at 13:46
  • @Ramhound: The vars are used at build time. A shipping Qt-based app clearly can't go around messing with QTDIR - what if you had 2 Qt-based apps from two companies? Instead, both ship with their private Qt libs. – MSalters Dec 4 '14 at 14:12
  • @MSalters - Are we talking about a build environment or production environment. If the variable is only used when the application is built then it does not matter if the variables exists or not. When I say the library is installed I mean within a build/development environment. – Ramhound Dec 4 '14 at 14:50
  • @Ramhound: Ah, I see. I would have phrased that as "Those libraries must be installed on each machine in order to build the software that requires them." - hence my confusion. – MSalters Dec 4 '14 at 14:56
  • @MSalters - I suppose I also don't understand the author's question. I am familiar with QT and OpenCV just never used them personally, I just assumed, in order to build the software there is a library installation that exists. I would assume that's when the variables are created in order to build the software. I would also assume a Qt-based application would work similar to exists applications, it would first look in the application directory for the dll, then going down the list of locations that Windows uses locate the dll if its not in the application directory itself. – Ramhound Dec 4 '14 at 15:00

They're stored in the user's registry, at HKEY_CURRENT_USER\Environment, which is part of the profile.

  • I took the author's question to indicate the user is on a domain, and they wanted to know, if the variable would be attached the user profile or not ( i.e. the variable would exist on all machines the user uses ). – Ramhound Dec 4 '14 at 14:47
  • @Ramhound: We're probably in violent agreement. Yes, these vars are in the profile. If that is a roaming profile, the environment variabes also roam. – MSalters Dec 4 '14 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.