undefined reference to `gzopen' in moses

强颜欢笑 提交于 2019-12-01 21:29:16

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!