Solved

How does MSVC++ 6.0 determine the PATH for builds

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

747 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

10 Experts available now in Live!

Get 1:1 Help Now