Compiling C and C++

G

Guest

I am working on a language project and am using flex to generate a scanner .
The output of flex is a C file, lex.yy.c I want to use classes (C++) for
all other phases of the project. When I compile the lex.yy.c I get an
error: - C1010 unexpected end of file while looking for precompiled header
directive. When I include stdafx.h I get an error: C1853 Debug/flextest.pch
is not a precompiled header file created with this compiler. What am I doing
wrong?
 
C

Carl Daniel [VC++ MVP]

Greg said:
I am working on a language project and am using flex to generate a
scanner . The output of flex is a C file, lex.yy.c I want to use
classes (C++) for all other phases of the project. When I compile
the lex.yy.c I get an error: - C1010 unexpected end of file while
looking for precompiled header directive. When I include stdafx.h I
get an error: C1853 Debug/flextest.pch is not a precompiled header
file created with this compiler. What am I doing wrong?

You need to make your stdafx.h compatible with a C compiland, OR disable
precompiled headers for that file, the latter being the more practical
solution, I'd expect.

-cd
 

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

Similar Threads


Top