This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 158867 - MSVC needs various windows paths set in the enviornment.
Summary: MSVC needs various windows paths set in the enviornment.
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Toolchain (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P4 blocker (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks: 160172
  Show dependency tree
 
Reported: 2009-02-20 00:51 UTC by charlweed
Modified: 2011-04-27 16:18 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
bash script to convert windows path to cygwin path (227 bytes, text/plain)
2009-02-20 00:53 UTC, charlweed
Details
script to covert cygwin path to windows path (233 bytes, text/plain)
2009-02-20 00:54 UTC, charlweed
Details
script to covert windows path to dos path (188 bytes, text/plain)
2009-02-20 00:54 UTC, charlweed
Details

Note You need to log in before you can comment on or make changes to this bug.
Description charlweed 2009-02-20 00:51:54 UTC
Before running the tools in MSVC, the Microsoft supplied batch file 
vcvarsall.bat
needs to be run. This file is located in 

(INSTALL DIR)Microsoft Visual Studio 9.0\VC

The batch file runs another batch file, which sets various windows paths. These values need to be in windows form, not
cygwin form.

It is not sufficient to call this batch file from a make file, because the values will not be exported into the make
shell, nor the cygwin environment.
Looking in the original batch file for Microsoft Visual Studio 9.0, I have identified:

PATH
WindowsSdkDir
VSINSTALLDIR
VCINSTALLDIR
FrameworkDir
FrameworkVersion
Framework35Version
INCLUDE
LIB
DevEnvDir
LIBPATH

One can set these values directly in the make environment, but care must be taken with the backslashes, spaces, and
semicolons of windows paths. At least some of them, 

I wrote a few bash scripts which I put into the nbproject directory, I'll attach them. I am using them like this:

WIN_PATH="Q:\\bin\\Microsoft Visual Studio 9.0\\Common7\\IDE;Q:\\bin\\Microsoft Visual Studio
9.0\\VC\\BIN;Q:\\bin\\Microsoft Visual Studio
9.0\\Common7\\Tools;C:\\WINDOWS\\Microsoft.NET\\Framework\\v3.5;C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727;Q:\\bin\\Microsoft
Visual Studio 9.0\\VC\\VCPackages;$(WindowsSdkDir)\\bin"

cygwin_path=$(shell nbproject/win_to_cygwin_path $(WIN_PATH))
export PATH:=$(cygwin_path):$(PATH)

At the moment, I have not verified that I have correctly integrated the variables above into both the cygwin and windows
environments.
Comment 1 charlweed 2009-02-20 00:53:40 UTC
Created attachment 77178 [details]
bash script to convert windows path to cygwin path
Comment 2 charlweed 2009-02-20 00:54:21 UTC
Created attachment 77179 [details]
script to covert cygwin path to windows path
Comment 3 charlweed 2009-02-20 00:54:49 UTC
Created attachment 77180 [details]
script to covert windows path to dos path
Comment 4 charlweed 2009-02-20 00:58:38 UTC
Related to issue 158866
Comment 5 charlweed 2009-03-24 20:26:00 UTC
BTW, this is what I added to an unrelated Ant script to get the VS tools to run from an <exec></exec> task:
Visual Studio is on a separate drive, in "Q:\bin\Microsoft Visual Studio 9.0". The spaces in the path are a PAIN.

    <property name="VSINSTALLDIR" location="Q:\bin\MICROS~1.0"/>
    <property name="VCINSTALLDIR" location="Q:\bin\MICROS~1.0\VC"/>
    <property name="FrameworkDir" location="C:\WINDOWS\Microsoft.NET\Framework"/>
    <property name="FrameworkVersion" value="v2.0.50727"/>
    <property name="Framework35Version" value="v3.5"/>
    <property name="WindowsSdkDir" location="c:\PROGRA~1\MI2578~1\Windows\v6.0A\"/>
    <property name="WIN_PATH_0" location="${WindowsSdkDir}\bin"/>
    <property name="INCLUDE_0"  location="${WindowsSdkDir}\include"/>
    <property name="LIB_0" location="${WindowsSdkDir}\lib"/>
    <property name="DevEnvDir" location="Q:\bin\MICROS~1.0\Common7\IDE"/>
    <property name="INCLUDE" location="Q:\bin\MICROS~1.0\VC\ATLMFC\INCLUDE;Q:\bin\MICROS~1.0\VC\INCLUDE;${INCLUDE_0}"/>
    <property name="LIB" location="Q:\bin\MICROS~1.0\VC\ATLMFC\LIB;Q:\bin\MICROS~1.0\VC\LIB;${LIB_0}"/>
    <property name="LIBPATH"
location="C:\WINDOWS\Microsoft.NET\Framework\v3.5;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;Q:\bin\MICROS~1.0\VC\ATLMFC\LIB;Q:\bin\MICROS~1.0\VC\LIB"/>
    <property name="WIN_PATH"
location="Q:\bin\MICROS~1.0\Common7\IDE;Q:\bin\MICROS~1.0\VC\BIN;Q:\bin\MICROS~1.0\Common7\Tools;C:\WINDOWS\Microsoft.NET\Framework\v3.5;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;Q:\bin\MICROS~1.0\VC\VCPackages;${WIN_PATH_0}"/>
    <property name="PATH" location="${WIN_PATH};${env.Path};"/>

        <exec executable="${vs.tool.exe}" >
            <arg line="${vs.tool.argline}"/>
            <env key="VSINSTALLDIR" value="${VSINSTALLDIR}"/>
            <env key="VCINSTALLDIR" value="${VCINSTALLDIR}"/>
            <env key="FrameworkDir" value="${FrameworkDir}"/>
            <env key="FrameworkVersion" value="${FrameworkVersion}"/>
            <env key="Framework35Version" value="${Framework35Version}"/>
            <env key="WindowsSdkDir" value="${WindowsSdkDir}"/>
            <env key="INCLUDE" value="${INCLUDE}"/>
            <env key="LIB" value="${LIB}"/>
            <env key="DevEnvDir" value="${DevEnvDir}"/>
            <env key="LIBPATH" value="${LIBPATH}"/>
            <env key="PATH" path="${PATH}"/>
        </exec>