Subject: Re: Compiling Bison-generated parsers with MS VC++?
From: [email-masked] (Gilles Depeyrot)

9 Oct 1998 08:23:19 -0700
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
To: "Christopher David Hundhausen" <[email-masked]>,
        <[email-masked]>

Hi Christopher,

I use several Bison/Flex parser/lexers in one of my Windows applications.
This should be absolutely no trouble since both Bison and Flex generate
portable C code. You do have to create an empty unistd.h include file
to get things to compile correctly.

Le (the) 7/10/98 18:04, Christopher David Hundhausen a écrit (wrote) :

>The next step is to get VC++ to compile a bison-generated parser that
>makes use of MFC classes.  Does anyone have any suggestions on
>how to get this to work?  At present, my compilation results in
>the following error messages:
>
>/cygnus/b19/share/bison.simple(327) : error C2065: 'yyerror' : undeclared
>identifier
>/cygnus/b19/share/bison.simple(333) : error C2065: 'alloca' : undeclared
>identifier
>/cygnus/b19/share/bison.simple(387) : error C2065: 'yylex' : undeclared
>identifier

SInce VC++ is a C++ compiler, both yyerror and yylex prototypes have to be
declared before they are used (at the top of the Bison grammar. I don't
recall having a problem with alloca, but I'll try to check that out.

>Once I get the parser to compile, what will I need to do to get
>everything to link properly with my MFC app?  Is there a gnu-win32
>object file that I need to include in the link? Does anyone have any
>advice?

Since you are compiling with VC++, you don't need any Gnu-Win32 libraries.
The VC++ libraries contain all of the C entry points used by Bison and Flex.

Cheers,
Gilles

Gilles Depeyrot                    <mailto:[email-masked]>
                             <http://perso.wanadoo.fr/gilles.depeyrot>

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".