undefined reference to `gzopen' in moses

9.5k Views Asked by At

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

There are 1 best solutions below

1
On BEST ANSWER

Put -lz after your files:

g++ score.cpp reordering_classes.o -lz -o score