其他分享
首页 > 其他分享> > c运行时动态库的几种配置方式

c运行时动态库的几种配置方式

作者:互联网

1、LD_LIBRARAY_PATH方式。系统管理员和DBA经常使用,oracle的做法。

2、修改配置文件/etc/ld.so.conf,然后执行ldconfig命令。

[lightdb@sdw ~]$ cat /etc/ld.so.c
ld.so.cache ld.so.conf ld.so.conf.d/
[lightdb@sdw ~]$ cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
[lightdb@sdw ~]$ cat /etc/ld.so.conf.d/
kernel-4.19.90-23.8.v2101.ky10.aarch64.conf opencryptoki-aarch64.conf sssd-aarch64.conf tracker-aarch64.conf
mysql-aarch64.conf openldap-aarch64.conf sudo-aarch64.conf tracker-miners-aarch64.conf
[lightdb@sdw ~]$ cat /etc/ld.so.conf.d/kernel-4.19.90-23.8.v2101.ky10.aarch64.conf
# Placeholder file, no vDSO hwcap entries used in this kernel.
[lightdb@sdw ~]$ cat /etc/ld.so.conf.d/mysql-aarch64.conf
/usr/lib64/mysql

3、编译的时候指定gcc参数 -Wl,-rpath。准确的说是链接参数,ld的参数。适合制作二进制版压缩包,全部自包含。例如依赖了三方源码,但是又不希望或无法安装到系统默认目录/usr/local/lib时可以使用。

 

标签:ld,lightdb,aarch64,配置,几种,etc,so,conf,动态
来源: https://www.cnblogs.com/zhjh256/p/15379310.html