Try this:
 
Start->Programs->Microsoft Visual Studio .NET 2003->Visual Studio.NET 2003 Tools->Visual Studio .NET 2003 Command Prompt
 
Then run your NAnt build in the that command prompt.
 
VSVars32.bat sets the INCLUDE environment variable so that CL.exe can resolve #includes and the LIB environment variable so that LINK.exe can resolved .libs.  It also sets PATH to point to the VC7 binaries so that CL.Exe and LINK.exe can be found.  The above command opens a command prompt and runs VSVars32.bat for you so that the environment is all set up.
 
 
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pat Lawrence
Sent: Thursday, June 30, 2005 9:45 AM
To: Thibaut Barrère
Cc: [email protected]
Subject: Re: [Nant-users] newbie question: system cannot find the C++ compiler <cl.exe>

Thank you for your help.  I tried calling the vsvars32 script and also tried putting it in the PATH but I couldn't get it to work.  I haven't yet graduated from school and am just a new intern here at the office, so I'm seeing PATH variables for the first time.  What I did do was put the
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin; close to the start of my PATH variable and when I call nant, it seems to be finding it--at least, there's no more of that 'cl failed to start'.  Was this a valid solution?
 
Unfortunately, it still isn't working.  It can't find afxwin.h.  This is part of the message I get:
 
[cl] StdAfx.cpp
[cl] c:\...\StdAfx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory
 
afxwin is the first header file called for in my code, so even if I manually fix the problem for this particular one somehow, it'll probably still crash on the next one and so on.  How do i "tell" it where to find the Visual Studio header files?  Should I reinstall and start over?  I'm starting to wonder if maybe I didn't make a big mistake at the beginning and that's why it's not finding these things.
 
Thanks again for your time.
Pat


Thibaut Barrère <[EMAIL PROTECTED]> wrote:
Hi Pat
 
Maybe calling the vcvars32.bat script in C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\vsvars32.bat before starting your script will solve the issue.
 
This should add the required folders to the PATH to ensure later calls to cl.exe are successful.
 
regards
 
Thibaut Barrère

 
2005/6/29, Pat Lawrence <[EMAIL PROTECTED]>:
Hello everyone,
I was asked to get some automated nightly builds going on several C++ .NET project that are all pretty huge.
 
I apologize for how basic this question is, but I've been fiddling both with very simple build files in order to compile just a single .cpp file and also with the solution task--in both cases, I get a message telling me that nant cannot find the C/C++ compiler (I think).
 
In the solution case:
 
BUILD FAILED
'cl' failed to start.
The system cannot find the file specified.
 
In the simple .cpp build case:
 
BUILD FAILED
...
NAnt.Core.BuildException: ...
'cl' failed to start ---> System.ComponentModel.Win32Exception: The system, cannot find the file specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInto startInfo)
...(and a bunch more "at" statements mentioning other [functions?])
 
I would really appreciate it if someone would tell me what I did wrong.
Pat


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Reply via email to