espeak安装报错error while loading shared libraries: libportaudio.so.2: cannot open shared object file...

环境:centos7.5,以最小化安装,安装完espeak后,执行espeak后报错:
espeak: error while loading shared libraries: libportaudio.so.2: cannot open shared object file: No such file or directory

执行ldconfig更新一下,还是不行。

因为/usr/local/lib/目录不在默认的搜索范围内,通过命令ldconfig也不行,查看ld.so.conf文件内容。

[root@localhost lib]# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf

进入/etc/ld.so.conf.d目录下,新建一个localusr.conf的文件
[root@localhost ld.so.conf.d]# cat localusr.conf
/usr/local/lib/

再次执行正常解决:
[root@localhost ld.so.conf.d]# ldconfig
[root@localhost ld.so.conf.d]# espeak -x -q -v en-us "I am a student."
aIa#m a# st'u:d@nt
[root@localhost ld.so.conf.d]# espeak --version
eSpeak text-to-speech: 1.48.03 04.Mar.14 Data at: /usr/share/espeak-data
[root@localhost ld.so.conf.d]#

你可能感兴趣的:(espeak安装报错error while loading shared libraries: libportaudio.so.2: cannot open shared object file...)