靜態庫路徑配置

2021-09-30 14:39:59 字數 544 閱讀 2619

今天在編譯高博《視覺slam十四講》的第六講時,安裝了g2o後,執行程式出現:

/home/hong/slambook-master/slambook-master/ch6/g2o_curve_fitting/build/curve_fitting: error while loading shared libraries: libg2o_core.so: cannot open shared object file: no such file or directory

在高博的部落格中,有人提出了解決方案,我彙總完善一下。主要的問題在於:系統預設的路徑是lib或者usr/lib,而g2o安裝後庫檔案是在usr/local/lib裡面,所以需要配置路徑。

/usr/local/lib

或者在etc/ld.so.conf.d/資料夾下touch乙個新.conf命名的檔案,在這個檔案中vim上面的路徑。(推薦這個方法)

注意:以上命令需要加sudo,否則許可權不夠。

最後,終端輸入:

sudo /sbin/ldconfig

完成配置。

參考:

靜態庫路徑配置

編譯高博 視覺slam十四講 的第六講g2o curve fitting時,從thirdparty安裝了g2o後,執行程式出現 error while loading shared libraries libg2o core.so cannot open shared object file no ...

spring boot靜態資源路徑配置

spring mvc static path pattern resources static locations classpath meta inf resources classpath resources classpath static classpath public file the ...

vue 靜態檔案配置請求路徑

靜態目錄下面放入config.json檔案 用於以後更改配置 這個是出現在打包以後的資料夾的 baseurl 通常有乙個單獨的js檔案來配置專案的各種url 我這裡是api.js let configs 獲取靜態json資料 let getjsondata function url configs ...