Solved

How does MSVC++ 6.0 determine the PATH for builds

Posted on 2008-10-21
3
319 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
  • 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP.net build a IF/Then Walkthrough Guide 1 240
FMX enumerated colours 2 119
c++ syntax question 9 52
Unable to start eclipse ? 17 154
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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 how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

820 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