问题
I'm currently trying to install moses script, part of moses the machine translation tool, but keep getting error:
/home/moses/scripts/training/lexical-reordering/reordering_classes.cpp:349: undefined reference to `gzopen'
/home/moses/scripts/training/lexical-reordering/reordering_classes.cpp:353: undefined reference to `gzwrite'
/home/moses/scripts/training/lexical-reordering/reordering_classes.cpp:356: undefined reference to `gzclose'
I'm using gcc 4.6.1 in Ubuntu 11.10, and already installed the zlib1g-dev package. The moses source is the latest (2010-08-13).
What should I do? Do I need to install some additional package?
回答1:
Put -lz
after your files:
g++ score.cpp reordering_classes.o -lz -o score
来源:https://stackoverflow.com/questions/8259441/undefined-reference-to-gzopen-in-moses