Error compiling MyC language service project

Hi,

I am trying to build a language service (VS 2003). I started by trying to build the MyC language service available in <VSIP_Root>\EnvSDK\Babel\MyCLangService. However, i first got the an error from the post-compilation tool about some m4sugar file. I searched online and downloaded the bison package and got the m4sugar directory and put it in the appropriate folder (the tool was giving error on ..\share\bison\m4sugar\m4sugar.m4 path, so i put it there), and that error went away. Then it gave me a new error:

Running Bison on c:\Program Files\Vsip 7.1\EnvSDK\Babel\Sources\Client\MyC\parser.y
..\tools\bison.exe: m4: No such file or directory

Now there is an m4 directory in the bison package that i downloaded, but i don't have the slightest idea where to put it. Since its not giving any path i assumed the current directory, but that didn't work out. In fact i tried putting it in almost every sub-directory under the "EnvSDK\Babel\" directory, but to no avail.
Can someone please help me out here I want to get this project compiled so that i can start on my own. Thanks in advance.



Answer this question

Error compiling MyC language service project

  • Patrick MCormick

    Being familar with the Babel.doc whitepaper and the Babel section in the VS Help collection is a mandatory first step.

    Are you using 1.24 or later of Bison, and 2.5.4a or later of Flex

    When I attempt to build bservice.sln ( as suggested in the docs ), I get

    Running Bison on c:\Program Files\Vsip 7.1\EnvSDK\Babel\MyCLangService\parser.y


    and no mention of m4, sugar or any other such beast.

    Both "How to:Create a Language Service using the Visual Studio Language Service Wizard" and "Walkthrough"Adding a Language Service using Babel" describe where to place the tools, as in:

    You must provide your own lex/yacc-compatible tools They are not included in the VSIP builds and the language service project will not build without them. To build the language service using the sample grammar and parser for the sample My C Package, you must use version 1.24 or later of Bison and version 2.5.4a or later of Flex. Place the Bison and Flex executables in the <root>\Program Files\VSIP 7.1\EnvSDK\Babel\Tools folder. These version numbers are specific to the My C sample.



  • delomar

    I was also getting the error bison.exe: m4: No such file or directory

    I found the solution from a post in another forum: http://lists.cs.uiuc.edu/pipermail/llvmdev/2004-November/002558.html

    Here is my custom build step for parser.y... I installed the GnuWin32 bison and lex tools in C:\Program Files\GnuWin32 (see below for links), and amended the build steps to the following - the key is the M4 environment variable:

    set INIT=C:\Program Files\GnuWin32\bin

    set M4=C:\Program Files\GnuWin32\bin\M4.exe
    Set BISON_SIMPLE=C:\Program Files\GnuWin32\bin\bison.simple
    "C:\Program Files\GnuWin32\bin\bison.exe" -v -o$(InputName).cpp -d $(InputName).y


    Here are the links to flex and bison. The easiest route is to install the complete packages (setup programs), which also contain options to download the source if required:

    Flex: http://gnuwin32.sourceforge.net/packages/flex.htm
    Bison: http://gnuwin32.sourceforge.net/packages/bison.htm

    Hope this helps anyone else looking here for a solution.

    Rob

  • sulu

    Where do you install the files if you are running vs2005.  I have the sdk installed in c:\program files\Visual Studio 2005 SDK.  I have tried severl locations but I am still getting the error launching bison.

     

    Thanks

    Jim



  • Error compiling MyC language service project