Baffled!

M

Mark Thomas

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
 
M

Mike Wahler

Mark Thomas said:
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
 
M

MPBroida

Mark said:
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
 
M

Mark Thomas

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 said:
Mark said:
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
 
J

Jonathan Mcdougall

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-lite/how-to-post.html#faq-5.4


Try msnews.microsoft.com, they have got plenty of newsgroups.


Jonathan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top