GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 27-Jul-2005, 02:25
Guest1234 Guest1234 is offline
New Member
 
Join Date: Jul 2005
Posts: 7
Guest1234 is on a distinguished road

unexpected end of file while looking for precompiled header directive


I have a project to do for university, and for some reason I wrote the
essential classes of the application in one project, and then the gui classes in another project. I copied the files of the essential classes to a directory
called "Model" in the directory of the gui project, When I added the files of the essential classes to the gui project and tried to compile them, I got this fatal error: "unexpected end of file while looking for precompiled header directive"

Those files worked just fine when they were in their original project.
What does this error mean, and what should I do to solve it?

PS
I'm using Microsoft Visual Studio 2002
  #2  
Old 27-Jul-2005, 04:30
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 893
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough
Quote:
Originally Posted by Guest1234
I have a project to do for university, and for some reason I wrote the
essential classes of the application in one project, and then the gui classes in another project. I copied the files of the essential classes to a directory
called "Model" in the directory of the gui project, When I added the files of the essential classes to the gui project and tried to compile them, I got this fatal error: "unexpected end of file while looking for precompiled header directive"

Those files worked just fine when they were in their original project.
What does this error mean, and what should I do to solve it?

PS
I'm using Microsoft Visual Studio 2002

It seems that you are using the precompiled headers option. Therefore, you have to include the stdafx header at the beginning of each .cpp file (before any other include).

CPP / C++ / C Code:
#include "stdafx.h"

P.S: stdafx == Microsoft crap!

Best regards,
Lucian
__________________
Please read these Guidelines before posting on the forum

"A person who never made a mistake never tried anything new."
Einstein
  #3  
Old 27-Jul-2005, 06:49
Guest1234 Guest1234 is offline
New Member
 
Join Date: Jul 2005
Posts: 7
Guest1234 is on a distinguished road
Thanks a bunch it did the treak!
As for the stdafx, yeah I know it's crap, but unfortunately I had to write the
gui of the project using mfc, which is a total disaster.
If I had a say in this I would probably use some other library, come to think of it I would probably have written the project in Java.
  #4  
Old 29-Jul-2005, 14:12
aie0 aie0 is offline
Member
 
Join Date: Dec 2004
Posts: 246
aie0 is a jewel in the roughaie0 is a jewel in the rough
Set precompiled headers option to "Automatically Generate (/YX)" and your error will disappear
Project properties -> c/c++ -> precompiled headers
  #5  
Old 01-Dec-2005, 09:12
mike east mike east is offline
New Member
 
Join Date: Dec 2005
Location: Boulder Colorado
Posts: 1
mike east is on a distinguished road

Re: unexpected end of file while looking for precompiled header directive


Greetings,

I got to tell ya. I love working in C++ because it gives me the lower level control I need for the instrument control software that I write.

But man, it is full of little hidden details. I've haven't done any code since 1999 until recently when I got Visual C++6 and started a new program. Wow... every day I was/am buried in roadblocks. This thread subject was one of them. (Which is now resolved - thanks to you'all)

aie0 and LuciWiz, I do not know how you learned all this stuff.... but without the folks like you that I find thru Internet searches, sample code and MSDN forums, I would have been shut down on day 1.

In other professions, "tricks of the trade" are closely guarded secrets, and novices can't get anyone to give them any advice.

I sure appreciate both the professionalism and good hearted attitude of the people who particpate in these software sites.

I wish I could give something back.... but I'm a mere babe in the woods...... let me know if you have a question about Criminal Law (my previous profession) or thermodynamics (my current gig)..... maybe I can help in fields I know something about.

Thanks again,

Mike
 
 

Recent GIDBlogMeeting the populace by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Airport Log program using 3D linked List : problem reading from file batrsau C Programming Language 11 29-Feb-2008 07:44
Apache2 config issues monev Apache Web Server Forum 2 28-Jun-2004 06:19
Yet another CD burner problem: Lite-On LSC-24082K Erwin Computer Hardware Forum 1 22-May-2004 11:28
Can't view pages from another machine on the Intranet aevans Apache Web Server Forum 9 14-May-2004 02:26

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 15:58.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.