我编译一个小程序老是提示下面这个:
-------Configuration:hello--win32 Debug----
compiling...
hello.cpp
d:\c++专用\djmlijun1\hello.cpp(1):fatal error4 C1010:Unexpected end of file while looking for precompiled header directiveError executing C1.exe.
hello.obj -- 1 error(s),0 warning(s)
就这个错误,郁闷呢,老是通不过,多谢了!!!
-------Configuration:hello--win32 Debug----
compiling...
hello.cpp
d:\c++专用\djmlijun1\hello.cpp(1):fatal error4 C1010:Unexpected end of file while looking for precompiled header directiveError executing C1.exe.
hello.obj -- 1 error(s),0 warning(s)
就这个错误,郁闷呢,老是通不过,多谢了!!!
如果在hello.cpp中加上#include "stdafx.h",
不行的话,就是别的地方没写对,
#include <iostream.h>
#include <stdAfx.h>
int main()
{
std::cout<< "Hello";
return 0;}这是编译时的错误:
--------------------Configuration--djmlijun2--Win32Debug--------------------
Compiling...
Hello2.cpp
D:\练习c++专用\djmlijun2\Hello2.cpp(6) : error C2653: 'std' : is not a class or namespace name
D:\练习c++专用\djmlijun2\Hello2.cpp(6) : error C2065: 'cout' : undeclared identifier
D:\练习c++专用\djmlijun2\Hello2.cpp(6) : error C2297: '<<' : illegal, right operand has type 'char [6]'
Error executing cl.exe.Hello2.exe - 3 error(s), 0 warning(s)你说这到低错在哪了???????????
如果是std不能识别的话,那么怎么才能用std呢??????????
多谢了楼上楼下!!!!
using namespace std;
#include <iostream>
#include <stdAfx.h>
int main()
{
std::cout<< "Hello";
return 0;}
#include <iostream>
using namespace std;int main()
{
std::cout<< "Hello";
return 0;}