直接在命令行输入:
# locate lib***
显示出文件所在路径,
然后在命令行:
# ln -s 文件路径/文件名 /usr/lib/文件名
应该解决了。
例如:
# gcc first.c -lclntsh
/usr/bin/ld: cannot find -lclntsh
collect2: ld 返回 1
# locate libclntsh
/u01/app/oracle/product/11.2.0/dbhome_1/inventory/Scripts/ext/lib/libclntsh.so.11.1
/u01/app/oracle/product/11.2.0/dbhome_1/inventory/backup/2015-06-17_10-32-34AM/Scripts/ext/lib/libclntsh.so.11.1
/u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so
/u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.10.1
/u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1
# sudo ln -s /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so /usr/lib/libclntsh.so
时间: 2024-12-28 20:56:10