Solved

How does MSVC++ 6.0 determine the PATH for builds

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Implementing a ResolveEventHandler in C++ 13 115
Fast access to array, using indexes, smart iterative search 2 108
C++ question 3 62
Which Linux flavors will this run on? 6 76
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now