M4 "No such file or directory".Bison
Asked Answered
D

6

8

This is my code in file skener.y

 %{
#include <stdio.h>
%}
%token T_Int
%%

exp:      T_Int           { $$ = $1;         }
| exp exp '+'     { $$ = $1 + $2;    }
| exp exp '-'     { $$ = $1 - $2;    }
| exp exp '*'     { $$ = $1 * $2;    }
| exp exp '/'     { $$ = $1 / $2;    }

;
%%

When I compile it with comand "bison -d skener.y" I get error "m4: No such file or directory.". Of course I am located in working folder when typing command in prompt. I dont know what is it about?

Dido answered 8/5, 2013 at 13:53 Comment(0)
B
9

There seems to be some error in the bison.exe file. I replaced it with the one found inside this zip file. http://marin.jb.free.fr/bison/bison-2.4.1-modified.zip

Source:http://marin.jb.free.fr/bison/

Bandstand answered 1/12, 2013 at 14:59 Comment(0)
B
5

There should be no space in the name of any folder in the path. In my case I kept it in C:/Program Files/GnuWin32/bin and it caused the error. Then I moved the folder from Program Files and placed as C:/GnuWin32/bin and it starts working well.

Boogie answered 5/12, 2019 at 18:19 Comment(0)
T
4

Moved the Folder from

C:\Program Files(x86)\GnuWin32 

to

C:\GnuWin32

then, added PATH values to both user variables and system variables as:

C:\GnuWin32\bin
Timmytimocracy answered 10/2, 2022 at 17:37 Comment(0)
B
3

I got this same error when I installed the GnuWin32 version of bison via their Setup.exe on my Windows 7 PC. The solution was to add the ...\GnuWin32\bin dir to my PATH. (Interestingly, this is first tool of many that had a problem when not in my PATH)

Beowulf answered 24/6, 2013 at 20:10 Comment(1)
This was part of the problem for me. Tarun's solution was the other part. I just modified the path within my batch file that calls BISON. Thanks for this tip.Boggle
A
2

In my case, I solved it following the jfritz42 answer, but had to add the

...\MinGW\bin
path too to my System Environment Variables...

Let screenshots of my case, hope it helps:)

Step 1

Step 2

Step 3

Acephalous answered 8/9, 2019 at 14:35 Comment(0)
W
0

It means that you haven't installed bison properly -- you have an executable, but it is missing its support files.

Go back and reinstall bison.

Wines answered 8/5, 2013 at 15:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.