473,386 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Baffled!

Hi
I do not understand why the following does not compile under Visual C++
7.1. It is just a simple "Hello, World" program.

// Hello World Application. Why does this fail?

#include <iostream>

using namespace std;

int main(int argc, char* argv[])

{

cout<<"Hello World"<<endl;

return 0;

}

MyFirstConsolApp.cpp(11) : fatal error C1010: unexpected end of file while
looking for precompiled header directive
Jul 19 '05 #1
4 2881

"Mark Thomas" <th***********@nterlynx.net> wrote in message
news:JO*************@nntp-post.primus.ca...
Hi
I do not understand why the following does not compile under Visual C++ 7.1. It is just a simple "Hello, World" program.

// Hello World Application. Why does this fail?

#include <iostream>

using namespace std;

int main(int argc, char* argv[])

{

cout<<"Hello World"<<endl;

return 0;

}

MyFirstConsolApp.cpp(11) : fatal error C1010: unexpected end of file while
looking for precompiled header directive


This is not a language problem, but one with your IDE.
Look around the menus for 'Use Precompiled Headers' and
turn them off (learn about if, how and when to use them later --
see the help files). Further questions about the Visual C++ IDE
should go to newsgroup microsoft.public.vc.ide_general

Your code looks fine to me.

-Mike
Jul 19 '05 #2
Mark Thomas wrote:

Hi
I do not understand why the following does not compile under Visual C++
7.1. It is just a simple "Hello, World" program.

// Hello World Application. Why does this fail?

#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
cout<<"Hello World"<<endl;
return 0;
}

MyFirstConsolApp.cpp(11) : fatal error C1010: unexpected end of file while
looking for precompiled header directive


Try changing your project settings to "No Precompiled Headers".

Mike
Jul 19 '05 #3
Thanks guys. I found a setting and turned it off. Now my programs work.
Pretty sad when the first learning demo in the book will not compile.

I have tried to find a Visual C++ newsgroup, but all I found was
microsoft.public.USASalesInfo.Developer.C++
Maybe there are groups that my ISP does not carry. Sorry for the OT but I
was baffled.
"MPBroida" <michael.p.broida@boeing_oops.com> wrote in message
news:3F99AB7F.B4854A2D@boeing_oops.com...
Mark Thomas wrote:

Hi
I do not understand why the following does not compile under Visual C++ 7.1. It is just a simple "Hello, World" program.

// Hello World Application. Why does this fail?

#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
cout<<"Hello World"<<endl;
return 0;
}

MyFirstConsolApp.cpp(11) : fatal error C1010: unexpected end of file while looking for precompiled header directive


Try changing your project settings to "No Precompiled Headers".

Mike

Jul 19 '05 #4
>>>
MyFirstConsolApp.cpp(11) : fatal error C1010: unexpected end of
file while looking for precompiled header directive
Try changing your project settings to "No Precompiled Headers".

Thanks guys. I found a setting and turned it off. Now my programs
work. Pretty sad when the first learning demo in the book will not
compile.

I have tried to find a Visual C++ newsgroup, but all I found was
microsoft.public.USASalesInfo.Developer.C++
Maybe there are groups that my ISP does not carry. Sorry for the OT
but I was baffled.

Please do not top post

http://www.parashift.com/c++-faq-lit...t.html#faq-5.4
Try msnews.microsoft.com, they have got plenty of newsgroups.
Jonathan

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Lazareth S. Link | last post by:
Hiya to whoever might stumble across this. I've recently taken up learning how to script/program in python. I've made my first program, a simple fahrenheit-celsius converter, both ways. For...
6
by: Doug Baroter | last post by:
Hi, Don't worry about the vars, they are defined, the following line give me an err of "Incorrect syntax near '.'." Goal: to rename nonstardard column name. EXEC sp_rename...
4
by: Steve K | last post by:
While I'm no css guru by any stretch, I thought I knew more than this, guess not. I'm trying to come up with a style for a few lines of text that are secondary to the text above them, so I want...
13
by: s_m_b | last post by:
I'm building a suite of online forms for insurance. These have been stripped down from messy MS Word templates, and two of the six, substantially identical, are misbehaving with the .js page that...
4
by: Tim Robinson | last post by:
Hi, I generally consider myself competent with the complexities of quoting but I can't figure out postgres at all. I've read the manual and it looks very straightforward but that doesn't accord...
17
by: sheldonlg | last post by:
I need to do some modifications on some code I just inherited and that code has me baffled. On one page, caller.php, with method get there is an anchor with href="foo.php?bar=123". On foo.php,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.