./main: error while loading shared libraries: libcalc.so: cannot open shared object file: No such file or directory
执行直接报错了,说明系统没有找到库位置
而动态库的搜索路径搜索的先后顺序是:
1.编译目标代码时指定的动态库搜索路径
2.环境变量LD_LIBRARY_PATH指定的动态库搜索路径
3.配置文件/etc/ld.so.conf中指定的动态库搜索路径
4.默认的动态库搜索路径/lib or /usr/lib