在编译uniMRCP的阿里插件时,使用到了一个自定义封装的动态库,libtool链接时报了如下错误:
libtool: link: CURRENT `-L/usr/local/lib/aly-speech/lib' must be a nonnegative integer
libtool: link: `-L/usr/local/lib/aly-speech/lib' is not valid version information
make[2]: *** [alirecog.la] 错误 1
make[2]: 离开目录“/usr/local/src/jinzw_mrcp_server/plugins/ali-recog”
make[1]: *** [all-recursive] 错误 1
make[1]: 离开目录“/usr/local/src/jinzw_mrcp_server/plugins”
make: *** [all-recursive] 错误 1
没有动过依赖的动态库,也没有改过代码,只是迁移到了一个干净环境,所以丈二摸不着头脑,找不到原因。上网搜了也没找到原因,抱着试试看的心态google上查了一下,也没有找到解决问题的答案,不过有一个哥们提到是版本不一致导致的。可以用ltmain.sh脚本检查一下。
我在build里面用ltmain.sh执行了一下,提示:
./ltmain.sh: line 126: CDPATH: command not found
./ltmain.sh: line 199: -e: command not found
./ltmain.sh: line 205: -e: command not found
: Version mismatch error. This is libtool 2.4.2, but the
: definition of this LT_INIT comes from an older release.
: You should recreate aclocal.m4 with macros from libtool 2.4.2
: and run autoconf again.
好像有点版本问题,按照这个说法,我执行了如下命令:
autoreconf --force --install
重新生成了aclocal.m4文件,并且重新运行autoconf了一次。
再次编译..
编译通过!
感谢国外那位小哥!