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")
至此,这个问题得到解决
4.对inflateValidate@ZLIB_1.2.9 未定义的引用
报错提示:
//home/jia/Software/anaconda3/lib/libpng16.so.16:对‘inflateValidate@ZLIB_1.2.9’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/main.dir/build.make:363: recipe for target 'main' failed
make[2]: *** [main] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/main.dir/all' failed
make[1]: *** [CMakeFiles/main.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
问题所在:
不明,只有安装anaconda之后才出这个问题
解决:
i. 注释掉anaconda的环境
vim ~/.bashrc
注释掉anaconda的export... 这一句
ii.删除conda的libpng环境
conda remove libpng
iii.恢复anaconda的路径
vim ~/.bashrc
取消之前对anaconda的注释
这时,问题得到了解决