Solved

How does MSVC++ 6.0 determine the PATH for builds

Posted on 2008-10-21
3
333 Views
Last Modified: 2012-08-14
How does MSVC++ 6.0 determine the value of the PATH environment variable for a build?  When I dump the path using a custom build step.  When I dump the PATH from a command line, it is different.  Example shown below.  I guess I was expecting it to use the same PATH in MSVC++ 6.0 that I see from the command line.

From build:

Performing Custom Build Step on .\Debug\PathTest.exe
PATH=C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\VC98\BIN;C:\Program Files\Microsoft Visual Studio\Common\TOOLS;C:\Program Files\Microsoft Visual Studio\Common\TOOLS\WINNT;C:\Program Files\Spe
cial\IBM\WebSphere MQ\Java\lib;C:\Oracle\ora920\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Symantec\pcAnywhere;C:\Program Files\Nestle\MSTools;C:\PROGRA~1\Special\IBM\IMNNQ;C:\Program
 Files\Special\SQLLIB\BIN;C:\Program Files\Special\SQLLIB\FUNCTION;C:\Program Files\Special\SQLLIB\SAMPLES\REPL;C:\Program Files\Special\SQLLIB\HELP;C:\Program Files\Special\IBM\WebSphere MQ\bin;C:\Program Files\Special\IBM\WebSphere MQ\tools\c\samp
les\bin;C:\Program Files\special\Rational\common;C:\Program Files\special\Rational\ClearCase\bin;C:\Program Files\Special\Rogue Wave\Stingray Studio\Bin;C:\Program Files\Special\Rogue Wave\Stingray Studio\Lib;C:\Program Files\Special\Rogue Wave\Stin
gray Studio\Regex\Lib\VC6

From command line:

H:\>PATH
PATH=C:\Program Files\SAP\FrontEnd\SAPgui\wwi\;C:\Program Files\Special\IBM\WebSphere MQ\Java\lib;C:\Oracle\ora920\bin;C:\Program Files\Oracle\jr
e\1.1.8\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Symantec\pcAnywhere\;C:\Program Files\Nestle\MSTools\;C:\PROGRA~1\
Special\IBM\IMNNQ;C:\Program Files\Special\SQLLIB\BIN;C:\Program Files\Special\SQLLIB\FUNCTION;C:\Program Files\Special\SQLLIB\SAMPLES\REPL;C:\Pr
ogram Files\Special\SQLLIB\HELP;C:\Program Files\Special\IBM\WebSphere MQ\bin;C:\Program Files\Special\IBM\WebSphere MQ\tools\c\samples\bin;C:\Pr
ogram Files\Special\JProbe Suite 5.2.0\bin;C:\Program Files\Special\Lotus\Notes;c:\source\utility\sndmail;c:\Program Files\Microsoft SQL Server\9
0\Tools\binn\;C:\Program Files\Special\apache-ant-1.6.5\bin;C:\Program Files\Special\TortoiseCVS;C:\Program Files\QuickTime\QTSystem\;C:\Program
Files\Special\Rational\common;C:\Program Files\Common Files\Adaptec Shared\System;C:\Program Files\Remote Desktop
0
Comment
Question by:jribble
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Expert Comment

by:jose_juan
ID: 22774007
Hi,

all VS versions have a command line shortcut (to a batch file), this batch set all concrete variables for your VS version.

Try check it (is in VC directory).

Good luck!
0
 

Author Comment

by:jribble
ID: 22812763
I see what you are saying, but it seems I am missing something.  I would expect the build PATH being used to be the same as the PATH from a command line with the extra items added, but that is not the case (see below).  Do you know any reason why this would be so?

Performing Custom Build Step on .\Debug\PathTest.exe
PATH=
C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;
C:\Program Files\Microsoft Visual Studio\VC98\BIN;
C:\Program Files\Microsoft Visual Studio\Common\TOOLS;
C:\Program Files\Microsoft Visual Studio\Common\TOOLS\WINNT;
C:\Program Files\Special\IBM\WebSphere MQ\Java\lib;
C:\Oracle\ora920\bin;
C:\Program Files\Oracle\jre\1.1.8\bin;
C:\WINNT\system32;
C:\WINNT;
C:\WINNT\System32\Wbem;
C:\Program Files\Symantec\pcAnywhere;
C:\Program Files\Nestle\MSTools;
C:\PROGRA~1\Special\IBM\IMNNQ;
C:\Program Files\Special\SQLLIB\BIN;
C:\Program Files\Special\SQLLIB\FUNCTION;
C:\Program Files\Special\SQLLIB\SAMPLES\REPL;
C:\Program Files\Special\SQLLIB\HELP;
C:\Program Files\Special\IBM\WebSphere MQ\bin;
C:\Program Files\Special\IBM\WebSphere MQ\tools\c\samples\bin;
C:\Program Files\special\Rational\common;
C:\Program Files\special\Rational\ClearCase\bin;
C:\Program Files\Special\Rogue Wave\Stingray Studio\Bin;
C:\Program Files\Special\Rogue Wave\Stingray Studio\Lib;
C:\Program Files\Special\Rogue Wave\Stingray Studio\Regex\Lib\VC6

PATH from command line:

H:\>PATH
PATH=
C:\Program Files\SAP\FrontEnd\SAPgui\wwi\;
C:\Program Files\Special\IBM\WebSphere MQ\Java\lib;
C:\Oracle\ora920\bin;
C:\Program Files\Oracle\jre\1.1.8\bin;
C:\WINNT\system32;
C:\WINNT;
C:\WINNT\System32\Wbem;
C:\Program Files\Symantec\pcAnywhere\;
C:\Program Files\Nestle\MSTools\;
C:\PROGRA~1\Special\IBM\IMNNQ;
C:\Program Files\Special\SQLLIB\BIN;
C:\Program Files\Special\SQLLIB\FUNCTION;
C:\Program Files\Special\SQLLIB\SAMPLES\REPL;
C:\Program Files\Special\SQLLIB\HELP;
C:\Program Files\Special\IBM\WebSphere MQ\bin;
C:\Program Files\Special\IBM\WebSphere MQ\tools\c\samples\bin;
C:\Program Files\Special\JProbe Suite 5.2.0\bin;
C:\Program Files\Special\Lotus\Notes;
c:\source\utility\sndmail;
c:\Program Files\Microsoft SQL Server\90\Tools\binn\;
C:\Program Files\Special\apache-ant-1.6.5\bin;
C:\Program Files\Special\TortoiseCVS;
C:\Program Files\QuickTime\QTSystem\;
C:\Program Files\Special\Rational\common;
C:\Program Files\Common Files\Adaptec Shared\System;
C:\Program Files\Remote Desktop

0
 
LVL 5

Accepted Solution

by:
jose_juan earned 500 total points
ID: 22813564
Uhm...

the PATH is set for each user account...

Check your own PATH.

Check what user are in build step.

What type project you are using?

Also, you can try to debug all process (childs from your execution) and subprocess (e.g. file I/O access) to check all process and possible access to PATH environment variable.

Good luck!
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question