C++编程为何不能运行?

来源:百度知道 编辑:UC知道 时间:2024/06/23 15:57:49
#include <iostream.h>
int main ()
{
cout << "hello." << endl;
return 0;
}

编译后:
--------------------Configuration: huanyang - Win32 Debug--------------------
Compiling...
Error spawning cl.exe

huanyang.exe - 1 error(s), 0 warning(s)

运行后出现对话框:This file has been modified outside of the source editor.Do you want to reload it?

Error spawning cl.exe
这个看起来是你的VC安装似乎有问题

This file has been modified outside of the source editor.Do you want to reload it?
这个是说,你当前已经打开过的文件,在其他地方被修改了, 是不是要显示最新的文件内容
这个跟编译出错没有关系

到网上搜Error spawning cl.exe

会有一大堆相似问题 具体原因很多

这个百度知道也是相似问题
http://zhidao.baidu.com/question/90288727.html

编译器工具路径错误
vc不是正常安装的,重设路径 在那个directory/bin里边

我是按照这个改好的:

大多数情况下都是vc安装的问题

试试下面的方法吧:
Compiling...
Error spawning cl.exe

可能很多人在安装VC 6.0后有过点击“Compile”或者“Build”后被出现的“Compiling... ,Error spawning cl.exe”错误提示给郁闷过。很多人的选择是重装,实际上这个问题很多情况下是由于路径设置的问题引起的,“CL.exe”是VC使用真正的编译器(编译程序),其路径在“VC根目录\VC98\Bin”下面,你可以到相应的路径下找到这个应用程序。.2404633

因此问题可以按照以下方法解决:点击VC“TOOLS(工具)”—>“Option(选择)”—>“Directories(目录)”重新设置“Excutable Fils、Include Files、Library Files、Source Files”的路径。很多情况可能就一个盘符的不同(例如你的