Hi,
I created with Yacc and Lex on a computer with LINUX three files for a parser:
y.tab.c
y.tab.h
lex.tab.c
My parser is working greatly on the linux computer.
But when I add these three files to my Visual C++ 5.0 project, I get two errors when building : fatal error C1010: unexpected end of file while looking for precompiled header directive
Could you help, please.
Best Regards
beaglebuddy
May 6th, 1999, 10:27 AM
The problem is that when Dev Studio first creates a project, it turns on the "precompiled headers" setting. This speeds up compilation, although it makes adding new header files a huge annoyance and bother. There are two solutions:
Easy Solution:
1. turn off "precompiled headers".
In Dev Studio, select the "Project" menu, then "Settings". In the left most window, you'll see a tree of
all your projects files (usually you'll have a folder for "source files", "header files", "resource files", tc.).
The "precompiled header" setting can be turned on\off on an individual source file basis, or for all source files. Highlite the "source file" folder, or, if you don't have that, the name of the individual file that's causing you problems. Click on the "C\C++" tab, and then, from the drop down combo box, choose "precompiled headers". Choose the "Not using precompiled headers" radio button and rebuild your application.
Annoying solution
2. Add your new header file to the list of precompiled headers. I read how to do this once but have since forgotten. I remember thinking at the time that it was a big inconvenience to have to add every new header file to a list, so I just turned off the "precompiled header" setting.
Zorik Galstyan
May 6th, 1999, 11:30 AM
If your project contains stdafx.h then add
#include "stdafx.h"
line in .c files you adding to the project. Visual C++ uses precompiled headers trough stdafx.c file ( containing only line #include "stdafx.h").You will need also rename your files to make them having .cpp extension
Zorik Galstyan