Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

M4 "No such file or directory".Bison

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?

like image 538
Bodo Hombah Avatar asked May 08 '13 13:05

Bodo Hombah


3 Answers

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/

like image 92
Tarun Gehlaut Avatar answered Oct 18 '22 20:10

Tarun Gehlaut


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.

like image 38
Nishat Anjum Lea Avatar answered Oct 18 '22 19:10

Nishat Anjum Lea


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)

like image 39
jfritz42 Avatar answered Oct 18 '22 19:10

jfritz42