1 gcc main.c libmyhello.so -o hello 此時(shí)并不會(huì)報(bào)錯(cuò)(沒(méi)有 libmyhello.so 的話,會(huì)報(bào)錯(cuò)),但是接下來(lái)運(yùn)行該程序時(shí)會(huì)提示出錯(cuò),因?yàn)殡m然連接時(shí)用的是當(dāng)前目錄的動(dòng)態(tài)庫(kù),但是運(yùn)行時(shí)會(huì)到/usr/lib目錄下查找?guī)煳募???梢詫⑽募?libmyhello.so復(fù)制到目錄/usr/lib下,這樣運(yùn)行就不會(huì)報(bào)錯(cuò)了。 在終端輸入以下命令將...
www.dbjr.com.cn/article/2254...htm 2021-10-15