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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with VC++ .NET 4

Status
Not open for further replies.

lillith322

Programmer
Mar 11, 2005
4
US
Help please, I just loaded VC++ .NET and everytime I try to run a program I get
fatal error C1010: unexpected end of file while looking for precompiled header directive
I get this error even with the simplest programs and when I click on the error it takes me to the very last line in my file. I have no idea what I'm doing wrong. :)
 
It sounds like you're missing a closing brace. It happens sometimes.

Example:

void SomeFunction()
{
Doing something here;


This will give you an unexpected end of file.
 
#include <iostream>
using namespace std;

int main( )
{
cout << "Hello World";
cout << "I'm gonna compile\n";

return 0;
}

This even gives me the error. Arrrrgggh. Thanks for your help though
 
> fatal error C1010: unexpected end of file while looking for precompiled header directive

More or less, it's
Project settings->compiler->precompiled headers->off


--
 
In the future, when you create a new project, use Blank Project. Anything else will add settings that you don't need/want for simple console based applications like the code you posted.
 
It seems VS.NET has the same defect as VS 6.0.
Compile StdAfx.cpp by hand before other modules (and after adding new includes in StdAfx.h).
Don't off precompiled headers: your compilation will be slow (for example, with huge windows.h and Co)...
 
ArkM said:
Don't off precompiled headers: your compilation will be slow (for example, with huge windows.h and Co)...
Maybe true for larger projects, but if you look at lillith322's posted code it doesn't look like precompiled headers are going to be needed anytime soon.
 
if you're using "include <iostream>" (and not iostream.h- which i believe is no longer available in .net) try std::cout instead of just cout. you will also have to use std::endl instead of just endl.. i think you get the idea...
 
Thank you so much for the good advice. I really appreciate all of you taking the time. If anyone knows of a site where I can learn more about the Visual C++ project settings I would appreciate that info also. Again thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top