You should add more details about your distribution, for example under Ubuntu the right way to do this is to add a custom .conf
file to /etc/ld.so.conf.d
, for example
(您应该添加有关您的发行版的更多详细信息,例如在Ubuntu下,正确的方法是将自定义.conf
文件添加到/etc/ld.so.conf.d
,例如)
sudo gedit /etc/ld.so.conf.d/randomLibs.conf
inside the file you are supposed to write the complete path to the directory that contains all the libraries that you wish to add to the system, for example
(在文件内部,您应该编写包含您希望添加到系统的所有库的目录的完整路径,例如)
/home/linux/myLocalLibs
remember to add only the path to the dir, not the full path for the file, all the libs inside that path will be automatically indexed.
(记得只添加dir的路径,而不是文件的完整路径,该路径中的所有lib都将自动编入索引。)
Save and run sudo ldconfig
to update the system with this libs.
(保存并运行sudo ldconfig
以使用此库更新系统。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…