Advertisement

Fatal error C1010

Started by January 03, 2003 06:01 PM
5 comments, last by wolferey 21 years, 10 months ago
I am following an example in a book i got (C++ Primer Plus Fourth Edition by Stephen Prata). here is the code: #include <iostream> using namespace std; int main() { cout << "Come up and C++ me some time."; cout << "\n"; return 0; } I am using MS Visual Studios 6.0 enterprice Edition. Here is the error I get every time I try to compile my cpp script: ------------- --------------------Configuration: ans - Win32 Debug-------------------- Compiling... ans.cpp d:\[software]\msvs\msvs\msdev98\myprojects\ans\ans.cpp(9) : fatal error C1010: unexpected end of file while looking for precompiled header directive Error executing cl.exe. ans.obj - 1 error(s), 0 warning(s) ------------- What is wrong?
The problem should be solved by creating a new empty project (no pregenerated code/files from Visual C++), adding a new source file to it and retyping the code.
At least it worked on my computer when doing so...
But I don''t know the exact reason to this problem...
[My Lousy Page | Kings Of Chaos | Vampires | [email=lordlethis@hotmail.com]email.me[/email]]
Advertisement
I used to get this problem occasionally in VC++ 6.0. I was always able to fix it by making a whole new project and then copying the code...I''m not sure why the hell it does that.

"Alright Dan, I need you to finish this within the hour, and I need you to do it correctly....Oh yeah one more thing, Don''t F*** Me!"
- My Boss
"Alright Dan, I need you to finish this within the hour, and I need you to do it correctly....Oh yeah one more thing, Don't F*** Me!"- My Boss
Okey.. I''ll try creating an empty project.. just tell me how still in learning progress of MS VS 6.0..
This problem should be fixed by doing the following:

- Go to Project->Settings in the main menu
- Find the tab C/C++ on the settings property sheet
- Select "Precompiled Headers" from the pulldown menu
- Select the "Not using precompiled headers" radio button

This disables precompiled headers which you won''t need yet anyway, as you''re clearly just starting out.

Also, if you plan on doing a release build don''t forget to disable precompiled headers in the release build as well.
thanks, it worked :D
but what shall I do when I get further on and need it..?
Advertisement
Precompiled headers precompile frequently used headers so that header files you use in every cpp file anyway will be parsed only once, saving on build time. This should greatly reduce building time. Try downloading and building the FreeSpace 2 source (or Quake 2) and you''ll see what I mean, it takes a mind-boggling amount of time.

I tried using them once but it was too much trouble for me... try this or Google if the link doesn''t work.

This topic is closed to new replies.

Advertisement