關於ubuntu 16.04下 PCL庫使用時的一些問題:

1.  libvtkRenderingPythonTkWidgets.so 不存在的問題:

報錯:

-- The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.2/VTKTargets.cmake"
but not all the files it references.

 

問題所在:

/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so

   libvtkRenderingPythonTkWidgets.so 這個文件在/usr/lib/x86_64-linux-gnu/ 目錄下不存在

解決方法:

   首先查看python-vtk6是否安裝:

ls -l  /usr/lib/python2.7/dist-packages/vtk/libvtkRendering*

   如果沒有該文件,那麼執行:

sudo apt-get install puthon-vtk6

   如果顯示結果有,則已經安裝,問題就是程序所需文件不在那個目錄,那麼創建軟連接即可:   

sudo ln -s /usr/lib/python2.7/dist-packages/vtk/libvtkRenderingPythonTkWidgets.x86_64-linux-gnu.so /usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so

   注意,其中libvtkRenderingPythonTkWidgets.x86_64-linux-gnu.so 這個文件名字可能不是這樣子,只需要改成上一步判斷是否安裝時候時候顯示的文件名。

   

      至此,這個問題得到解決。

2. vtk不存在的問題

報錯:

-- The imported target "vtk" references the file
   "/usr/bin/vtk"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.2/VTKTargets.cmake"
but not all the files it references.

問題所在:

      ubuntu下,vtk是vtk6,所以創建 vtk6到vtk的軟連接即可

解決方法:

sudo ln -s /usr/bin/vtk6 /usr/bin/vtk

至此。這個問題得到解決。

list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")

3.找不到

報錯提示:

/usr/bin/ld: 找不到 -lvtkproj4

問題所在:

不明,一些博主發現這是一個屬於ubuntu16.04的bug

解決方法:

先安裝:

sudo apt-get install libproj-dev

在修復CMakeLists.txt中的一個鏈接錯誤:(在CMakeLists.txt 中添加一行 )

list (REMOVE_ITEM PCL_LIBRARIES "vtkproj4")

至此,這個問題得到解決

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章