|
-
June 10th, 1999, 06:40 PM
#1
fatal error C1010
When trying to add a .h header file along with its .cpp file to a MFC Wizard generated program I get this error when trying to compile "fatal error C1010: unexpected end of file while looking for precompiled header directive". The header file doesn't contain a class, just a function. I also get the same error when both files are blank and contain no code at all. So whats the trick here? what am I doing wrong? Please Help.
-
June 10th, 1999, 06:45 PM
#2
Re: fatal error C1010
Make sure you add:
#include "stdafx.h"
at the top of all your cpp files.
Rail
Recording Engineer/Software Developer
Rail Jon Rogut Software
[email protected]
http://home.earthlink.net/~railro/
-
June 10th, 1999, 06:52 PM
#3
Re: fatal error C1010
That did it! Thanks alot Rail.
-
June 10th, 1999, 07:48 PM
#4
Re: fatal error C1010
but how does adding #include "stdafx.h" matter?
-
June 10th, 1999, 10:52 PM
#5
Re: fatal error C1010
In your Project settings, in the C/C++ tab select Precompiled Headers as the Category and you should have "Use precompiled header file" selected. This will cause VC to create a precompiled header file. You also have to specify a file in the through header field. This defaults to stdafx.h. The compiler will ignore all code in the file up 'til (and including) that header and uses the precompiled header (pch) instead. So if you don't include the file name in this field, then the compiler will complain that it's reached the end of the file without reaching the precompiler header.
Rail
Recording Engineer/Software Developer
Rail Jon Rogut Software
[email protected]
http://home.earthlink.net/~railro/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|