delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/10/09/08:23:19

From: Gilles DOT Depeyrot AT wanadoo DOT fr (Gilles Depeyrot)
Subject: Re: Compiling Bison-generated parsers with MS VC++?
9 Oct 1998 08:23:19 -0700 :
Message-ID: <199810082011.WAA08747.cygnus.gnu-win32@wanadoo.fr>
Mime-Version: 1.0
To: "Christopher David Hundhausen" <chundhau AT cs DOT uoregon DOT edu>,
<gnu-win32 AT cygnus DOT com>

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:Gilles DOT Depeyrot AT wanadoo DOT fr>
                             <http://perso.wanadoo.fr/gilles.depeyrot>

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019