Bison.exe

0 views
Skip to first unread message

Jacinda Saleeby

unread,
Aug 3, 2024, 4:21:41 PM8/3/24
to efacibpu

I do know that VS Code is insufficient, and that installing VS 15 community does not add the path to cl.exe. Because I only need to go through this exercise to get the dll I am grossly unfamiliar with Visual Studio. Where is bison.exe? [And yes, I know that soundex() is in pdo_sqlite in *nix.]

It's possible that bison.exe (or the related files) is not on your system. In that case @Dmitry (and others') suggestion is correct.However, another fix is to launch the Developer Command Prompt in VS15 and be sure to run rootdir\bin\phpsdk_setvars.bat before you run configure. This solved my issue.

I am trying to compile QGIS in Visual Studio. I used OSGeo4W to download the packages, added Flex.exe and Bison.exe to my environment path. Downloaded QGIS Release 2.0, and launched a CMake-GUI with the option "Visual Studio 10". Then I configured my paths using the GUI tool.

Then I hit configure and generate, and it worked. I looked in my directory and there were Visual Studio Solution files available for me. Then I hit "Build All" and I got the following output in the "Output Window"

So this is where I am stuck. The first thing I tried was to download m4sugar.m4, which I found here -- I didn't really think it would work since I downloaded it from apple.com, but I thought it was worth a shot, I put it in the correct directory, and hit build... This time it displayed
Generating qgsexpressionparser.cpp but it just stalled there and wasn't able to give anymore output.

After doing some reading I got the impression that m4sugar.m4 is somehow not a standard file and that you need to use it while running msys or cygwin. So then I tried to do my Visual Studio Build with MSys but I was unable to run vcvars32.bat. Maybe I should try harder with that approach? Anyway to get this m4 file working?

I wanted to save time so i just copied the bison.exe to my c:\osgeo4w\bin with was already set in my %PATH%. And it requires all these other files. So I changed the path in my CMake-GUI to point to the actual Bison.exe with access to the appropriate relative paths, and I made sure that it wasn't in a directory with spaces, and then reconfigured my CMake-GUI and regenerated my project, and its working now.

Learning lex yacc for first time.but no code in bison is runningERROR: C:\GnuWin32\bin\bison.exe: m4: Invalid argumentI reinstalled bison checked the path but still the error is not going.Something wrong with m4 file

Most likely then, you have another m4 in your pathenvironment variable before the gnuwin32 one thataccompanies bison. Check this carefully.You can set the path C:\GnuWin32\bin at the top of the environment path variable list.Just move up this path on the top

When you attempt to build, it can't find win_bison.exe. But that makes sense, because the exe is inc:/win_bison_flex/win_bison.exe and the source project is in my personal folder. So there needs to be a path on the exe... but there isn't.

See this document, the %(RootDir)%(Directory) should be the path of the Item which is being executed. I can only find the xx.targets file in custom_build_rules folder, so I think it will try to find the win_bison.exe under that path. And maybe that's why windows can't find that program.

Since I can't reproduce same issue in my machine, I won't call all above a workaround. It could be better if there's any sample and details to reproduce the issue Hope the description makes some help:)

The next step is to install modern versions of bison and flex (see After installation and adding them to your path rename win_flex.exe to flex.exe and win_bison.exe to bison.exe) Furthermore you have to install python (version 2.7 or higher, see ). These packages are needed during the compilation process.

After installation it is recommended to also download and install GraphViz (version 2.38 or better is highly recommended). Doxygen can use the dot tool of the GraphViz package to render nicer diagrams, see the HAVE_DOT option in the configuration file.

If you want to produce compressed HTML files (see GENERATE_HTMLHELP) in the configuration file, then you need the Microsoft HTML help workshop. In the beginning of 2021 Microsoft took the original page, with a.o. the download links, offline the HTML help workshop was already many years in maintenance mode). You can download the HTML help workshop from the web archives at Installation executable.

After installing and Ghostscript you'll need to make sure the tools latex.exe, pdflatex.exe, and gswin32c.exe (or gswin64c.exe) are present in the search path of a command box. Follow these instructions if you are unsure and run the commands from a command box to verify it works.

Source is downloaded manually from the github website, and at the time of starting this activity, I have MySQL version 8. This is placed on a network drive. The source files is a big one, about 700 MB of size when it is unzipped.

Download the latest bison.exe for windows and place it in C:\Program Files (x86)\bison, update the PATH environment variable, re-start the cmake so that the new PATH settings will take effect, but I have:

Run cmake configure, but still get the exact same error as above, i.e. it still try to access the old directory of bison.exe instead of new one. Perform delete cache in cmake.exe, re-configure. There are no more errors in configuration phase and the configuration phase is done:

Try to use alternative bison from Copy the win_bison.exe to the existing GnuWin32 bin folder, and copy the data folder into the bin folder. Rename win_bison.exe to bison.exe and discard the old bison.exe. Perform recompiling and now it is a success:

Sorry for the delay in getting back to you on this issues. We have been swamped with issues so was not able to get to this. The SDK build setup builds this utility in Linux. From your build log, it appears that you may not be using CGtools 7.4.x as required by the build.

3. bconvert and romparse don`t seem to have .exe files built so make sure when you build the utilities that the .exe files are built. Instruxtions to build romparse: (YOu need bison.exe and flex.exe in MinGW)

This is part two of a series explaining how to convert example lex and yacc code from Lex & Yaccby Levine, Mason and Brown [1] to work on modern systems using flex and bison.Part one looked at compiling on a modern Linux system.This page explains how we made it compile without error on our Windows 7 system using Microsoft Visual Studio 2008 (MSVC++9).Note: This page is a bit out of date now, being written for MSVC 2008. See the note on Update for MSVC 2010+ below.

Most solutions we've seen for MSVC involve processing the flex and bison files on a Linux system like Cygwin and then copying the resulting .c and .h files across to MSVC to be compiled. Our solution here lets you put your .l (or .flex) and .y files directly into your MSVC project folder, edit them at will, and then process and compile it all with a single click.

The 4102 warning we disable is caused by the automatically-generated code [The label is defined but never referenced].This is generally one of those warnings you can safely disable without fear of hiding any real errors you might make in your code.

These library files (they are named ".a" but behave like ".lib" files) provide very minimal default functions.The library libfl.a provides yywrap() and main(),and liby.a provides yyerror() and its own version of main().In practice, you are probably better off providing your own versions.If you provide your own functions, you don't need to refer to these two libraries.

These make it easier to handle the frequently-changing lex.yy.c and y.tab.c files.Note this relies on bison using the "-b y" option (see the note below).The disadvantage of this technique is that you must always keep each set of project files in separate folders.

Finally, we can add our flex and bison files to the MSVC project.In this case we add our modified ch3-03.l and ch3-03.y files and flex_memory_fix.h(zipped files here, 2 kB).When we add these files, with the .l and .y extensions, MSVC should prompt us to use the FlexBison.rules custom build rules we made earlier.

Note the "Running bison" and "Running flex" lines in the output. These are the values in "Execution Description" we set when we created the build rules. Note it is important that bison runs first before flex.

The -b y option we set for win_bison makes sure the names of the output filesare always y.tab.h and y.tab.c (instead of foo.tab.h where foo.y is the name of yourbison file). This is convenient for us in the setup above. However, you may need to change your flex foo.l file if it refersto a file like foo.tab.h and make that y.tab.h

Some of the comments on the page refer to my attempts with the earlier version. I think the unistd.h problem related to that. To be honest I do everything in plain ANSI C, and never use the C++ options, so I wouldn't have noticed the effect of using the --wincompat option on the new version. I'll fix up the comment in due course. Our ISP is moving the site over to a new server at the moment and taking their time over it, so we cannot make any changes for the time being.

During creation rules I've noticed a little problem with invoking win_flex.exe or win_bison.exe tools from VS build system. May be you will be interested. The invoking working directory is not the same as *.y or *.l files placed in. So generated C code have #line directives with absolute paths to source grammar file. It can be critical if you place generated files under version control system and on different machines you have different paths.

The first things I did, as I always do with these machines, were to turn off Internet Enhanced Security, which has a habit of getting in the way, and then install the Firefox web browser. Then I installed the Chocolatey package manager for Windows. This is a pretty useful tool, somewhat similar to yum, dnf and apt. You need to install this via an administrative command shell. Once it was installed, in the same command shell I installed some more needed things, like this:

c80f0f1006
Reply all
Reply to author
Forward
0 new messages