riscy
asked on
Error spawning 'cmd.exe' from VS 2005 pro, c++
For a while I have been programming with VS 2005 pro with C#, the complier works okay.
I move on into C++ to experiment with class and interface, I started off with simple hello world application. I created new project (via tutorial webpage) and use C++.
//======================== ========== = main.cpp.
#include "stdafx.h"
#undef MessageBox
// Define our entry-point
int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpStrCmdString, int nCmdShow)
{
// Display a managed message-box
System::Windows::Forms::Me ssageBox:: Show("Hell o C++/CLI", "TestApp", System::Windows::Forms::Me ssageBoxBu ttons::OK) ;
return 0;
}
//======================== ========== = header file (stdafx.h)
// Common include file for Windows Platform SDK
#pragma once
// Minimum requirements
#define WINVER 0x0400 // Top-level Windows version, common for both Windows 95/98/Me and NT-family
#define _WIN32_WINNT 0x0400 // Windows NT 4.0
#define _WIN32_WINDOWS 0x0410 // Windows 98
#define _WIN32_IE 0x0400 // Internet Explorer 4.0
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
//======================== ========== ===Error message during debug
During debug process, it came up with error:-
Error spawning 'cmd.exe'
//======================== ========== ===BuildLo g
Build Log
Build started: Project: Hello_CLI, Configuration: Debug|Win32
Command Lines
Creating temporary file "c:\VS2005\CPlusPlus\Hello _CLI\Hello _CLI\Debug \RSP000003 30564928.r sp" with contents
[
/outputresource:"..\debug\ Hello_CLI. exe;#1" /manifest
.\Debug\Hello_CLI.exe.inte rmediate.m anifest
]
Creating command line "mt.exe @c:\VS2005\CPlusPlus\Hello _CLI\Hello _CLI\Debug \RSP000003 30564928.r sp /nologo"
Creating temporary file "c:\VS2005\CPlusPlus\Hello _CLI\Hello _CLI\Debug \BAT000004 30564928.b at" with contents
[
@echo Manifest resource last updated at %TIME% on %DATE% > .\Debug\mt.dep
]
Creating command line "c:\VS2005\CPlusPlus\Hello _CLI\Hello _CLI\Debug \BAT000004 30564928.b at"
Output Window
Embedding manifest...
Project : error PRJ0003 : Error spawning 'cmd.exe'.
Results
Build log was saved at "file://c:\VS2005\CPlusPlu s\Hello_CL I\Hello_CL I\Debug\Bu ildLog.htm "
Hello_CLI - 1 error(s), 0 warning(s)
//======================== ========== ==========
Now I investigated on internet and could make sense out of it. No lucks
I tried other program and it come with similar error...C++ is not working at all(!).
I move on into C++ to experiment with class and interface, I started off with simple hello world application. I created new project (via tutorial webpage) and use C++.
//========================
#include "stdafx.h"
#undef MessageBox
// Define our entry-point
int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpStrCmdString, int nCmdShow)
{
// Display a managed message-box
System::Windows::Forms::Me
return 0;
}
//========================
// Common include file for Windows Platform SDK
#pragma once
// Minimum requirements
#define WINVER 0x0400 // Top-level Windows version, common for both Windows 95/98/Me and NT-family
#define _WIN32_WINNT 0x0400 // Windows NT 4.0
#define _WIN32_WINDOWS 0x0410 // Windows 98
#define _WIN32_IE 0x0400 // Internet Explorer 4.0
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
//========================
During debug process, it came up with error:-
Error spawning 'cmd.exe'
//========================
Build Log
Build started: Project: Hello_CLI, Configuration: Debug|Win32
Command Lines
Creating temporary file "c:\VS2005\CPlusPlus\Hello
[
/outputresource:"..\debug\
.\Debug\Hello_CLI.exe.inte
]
Creating command line "mt.exe @c:\VS2005\CPlusPlus\Hello
Creating temporary file "c:\VS2005\CPlusPlus\Hello
[
@echo Manifest resource last updated at %TIME% on %DATE% > .\Debug\mt.dep
]
Creating command line "c:\VS2005\CPlusPlus\Hello
Output Window
Embedding manifest...
Project : error PRJ0003 : Error spawning 'cmd.exe'.
Results
Build log was saved at "file://c:\VS2005\CPlusPlu
Hello_CLI - 1 error(s), 0 warning(s)
//========================
Now I investigated on internet and could make sense out of it. No lucks
I tried other program and it come with similar error...C++ is not working at all(!).
ASKER
Please extend this...I not sure I understand this..
ASKER
On source suggest to do this and it seem to cure the problem but not sure if this is right solution
Project -> "Your project" Properties -> Configuration Properties-> Manifest Tool ->Input and Output -> Embed Manifest = No
The manifest file will be creating.
Please anyone explain to me what happen and why this fix this
thanks
Project -> "Your project" Properties -> Configuration Properties-> Manifest Tool ->Input and Output -> Embed Manifest = No
The manifest file will be creating.
Please anyone explain to me what happen and why this fix this
thanks
Goto Start --> Programs --> Microsoft Visual Studio .. -> Tools --> Visual Studio Command Prompt
Type "path > C:\path.txt" at the command prompt, and then "exit"
Goto Start --> Run and type "cmd.exe"
Type "path < C:\path.txt", and then "exit"
Type "path > C:\path.txt" at the command prompt, and then "exit"
Goto Start --> Run and type "cmd.exe"
Type "path < C:\path.txt", and then "exit"
ASKER
I followed the procedure and it came out
C:\Documents and Settings\Riscy>path<c:\pat h.txt
PATH=C:\MCC18\mpasm;C:\MCC 18\bin;%Sy stemRoot%\ system32;% SystemRoot %;%SystemR oot%\Syste m32\Wbem;C :\Program Files\Common Files\Roxio Shared\DLLShared\;C:\VXIPN P\WINNT\BI N;C:\Progr am Files\ZipGenius 6\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\P rogram Files\Common Files\Adobe\AGL;C:\MCC18\m pasm;C:\MC C18\bin;C\ WINDOWS\Mi crosoft.NE T\Framewor k\v1.1.432 2
I then tried again...error still there.
Riscy
C:\Documents and Settings\Riscy>path<c:\pat
PATH=C:\MCC18\mpasm;C:\MCC
I then tried again...error still there.
Riscy
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Okay that fix it...thanks
Would be useful for full explanition or reference material relating to this problem if you have any
The award is your.
Would be useful for full explanition or reference material relating to this problem if you have any
The award is your.
Setting the environment PATH variable in the control panel to the same value as the one echo %path% produces in the visual studio shell fixes this issue.
So, you need to change the path !!