在vc++中运行c++程序时出现可视致命错误

visual fatal error in vc++ while running c++ program

本文关键字:可视 致命错误 程序 vc++ 运行 c++      更新时间:2023-10-16

我是vc++新手。

#include<iostream.h>
void main()
{
    cout<<"hi this is vc++";
}

编译…

h.cpp

c:program filesmicrosoft visual studiomyprojectsnew1h.cpp(7):致命错误C1010:查找文件时意外结束预编译头指令执行cl.exe出错

h。对象- 1个错误,0个警告

Visual c++默认使用预编译的头文件,这个特性加快了编译速度,但这意味着你需要在你的cpp文件的顶部有一个#include "stdafx.h"。

另一种选择是关闭预编译头文件。下面是如何做到这一点(源代码和更多细节在这里):

在Visual Studio 2010中,通过右键单击CPP项目,选择"属性"并导航到"配置属性C/c++ 预编译头文件",可以从GUI控制此设置。对于其他版本的Visual Studio, GUI中的位置会有所不同。