-1

I'm trying to compile MulVal, everything is already setup tried all of the solutions, getting this error, don't know if it was from the compiler or the code it self.

this is the error i get when i type make inside /mulval directory

make[1]: Entering directory '/home/sulaiman/Tools/mulval/src/attack_graph'
g++ -g -DLINUX -Wno-deprecated lex.yy.o y.tab.cpp attack_graph.cpp -o attack_graph
graphit.tab.c:150:10: fatal error: graphit.tab.h: No such file or directory
compilation terminated.
make[1]: *** [Makefile:4: attack_graph] Error 1
make[1]: Leaving directory '/home/sulaiman/Tools/mulval/src/attack_graph'
make: *** [Makefile:9: attack_graph] Error 2

and here is The env Path for java, xsb and MulVAL.

export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_161
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$JAVA_HOME/bin:$PATH
export MULVALROOT=/home/sulaiman/Tools/mulval
export PATH=$MULVALROOT/bin:$MULVALROOT/utils:$PATH
export PATH=/home/sulaiman/Tools/XSB/bin:$PATH

and here is the make file inside mulval/src/attack_graph where the error happen

default: install

attack_graph: attack_graph.cpp attack_graph.h Queue.h lex.yy.o y.tab.cpp
    g++ -g -DLINUX -Wno-deprecated lex.yy.o y.tab.cpp attack_graph.cpp -o attack_graph

lex.yy.c: graphit.l
    lex  -olex.yy.c graphit.l 

lex.yy.o: lex.yy.c y.tab.cpp.h
    gcc -g -c lex.yy.c -o lex.yy.o

y.tab.cpp y.tab.cpp.h: graphit.y attack_graph.h 
    bison -dv graphit.y
    mv graphit.tab.c y.tab.cpp
    mv graphit.tab.h y.tab.cpp.h

install: attack_graph
    cp attack_graph ../../bin/

clean:
    rm -f y.tab.cpp y.tab.cpp.h lex.yy.c *.o attack_graph *.output

and here is the github repo that contain the mulval, for almost a week trying to solve this issue and didn't find a solution that worked for me.

1 Answer 1

0

I got the same error as you, here is how I solved it.

graphit.tab.c:150:10: fatal error: graphit.tab.h: No such file or directory compilation terminated.

This refers to the missing 'graphit.tab.h' file in your '/attack_graph' folder. Under normal circumstances this file is automatically generated, but it is not, so you need to generate it manually by running the following command.

bison -d /mulval/src/attack_graph/graphit.y

Maybe you will also get this error.

collect2: error: ld returned 1 exit status make[1]: 
*** [Makefile:4: attack_graph] Error 1
make[1]: Leaving directory '/home/mulval/src/attack_graph'
make: *** [Makefile:9: attack_graph] Error 2

If so, you can refer to this answer to modify the code in 'graphit.l'.

Error in MulVAL: multiple definition of `mylval'; collect2: error: ld returned 1 exit status

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.