Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error when compiling first program in Visual Studio.NET 1

Status
Not open for further replies.

gregquinn

Programmer
Feb 11, 2002
23
ZA
I downloaded Bruce Eckel's C++ manual and started going through it.

I'm on chapter 2 now and wrote the first program using Visual Studio.NET
when I compile the source code, I get the following error...

fatal error C1010: unexpected end of file while looking for precompiled
header directive

Here is my source

#include <iostream>
using namespace std;

int main()

{
cout << "Hello, World "
<< 8 << " Today!" << endl;
}

I can't figure out whats wrong here, must be something Visual Studio doesn't
like...

Thanks
 
I have gotten that error before, but havn't found a way to fix it without simply starting a new project again. Since it is a simple program I would recommend just starting the project over and deleting the old one, but if you make a large program and that happens I'm not sure what to do. Maybe someone else knows...

-Bones
 
If I rememeber correcty, I think I saw an option that said pre-compiled headers when starting a new Win32 app.

Maybe this is an option that needs to be checked, but I couldn't find it once I had started my actual project.
 
Hey Bones,

I got it figured out... There are two was to sort this problem out..

1.) type in #include "stdafx.h" as your first include

2.) Or if you are using pure C++, (For Visual Studio.NET) go to PROJECT - yourprojectname PROPERTIES - C/C++ - PRECOMPILED HEADERS - and turn ff precompiled headers.

Both work, but the project settings sounds better.

Greg
 
yes the 2nd option is the better one, precompiled headers tend to be more associated with MFC projects

Skute

&quot;There are 10 types of people in this World, those that understand binary, and those that don't!&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top