help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to convert an ActiveX control of an Assembler written using Flex


From: Hans Aberg
Subject: Re: How to convert an ActiveX control of an Assembler written using Flex and Bison
Date: Tue, 27 Nov 2001 11:35:24 +0100

At 14:08 +0500 2001/11/27, mohammad ali wrote:
>I have written an assembler using Flex and Bison tools. Now I need to
>implement my project as an AtiveX Control.But When I Include my files like
>"bisonfile.cpp_tab.c, lex.yy.c and other supporting files of the project",
>MFC reports error like   "c:\program files\microsoft visual
>studio\vc98\mfc\include\afx.h(16) :fatal error C1189: #error :  MFC requires
>C++ compilation (use a .cpp suffix)". I tried to fix this problem by
>tempering the afx.h. But results were as expected, It caused a lot of pbms
>else where.
>Now if u can guide me how can I solve my pbm.

Assuming that you merely want to compile under C++, and that your compiler
requires that C++ file names end in .cpp (I think on most compilers, one
should be able to add new suffixes):

Flex has a C++ option, either startup -+ or put "%option c++" in the .l
file, but in order to get it working with the C++ standard, I had to tweak
the skeleton file (or the sources), and put "std::" on standard streams
like "cin", "cout", etc.

Bison has not yet explicit C++ support, but compiles just fine under C++
(compile C files as C++). -- I gather you should change your file name
endings from .c to .cpp (or whatever is required by your compiler) in order
to compile it as C++. (You could also check your compiler manual for a
suitable #pragma to put in the file.)

  Hans Aberg





reply via email to

[Prev in Thread] Current Thread [Next in Thread]