在TX1上编译cpp文件,PCL安装位置在SSD上,cmake时出现错误:
Could not findPCLConfig.cmakeor pcl-config.cmake
解决办法: 在CmakeLists.txt中 find_package()上面添加set(PCL_DIR /media/nvidia/SSD-120G/usr/local/pcl-1.8.1/share/pcl-1.8/),其中/media/nvidia/SSD-120G/usr/local/pcl-1.8.1为pcl的路径。
CMake Error:Boost not Found(common is required but boost was not found)
解决办法:先sudo apt-get install libboost-all-dev安装完整版本boost,再修改PCLConfig.cmake中关于boost部分,修改set(BOOST_INCLUDEDIR "/usr/include")为set(BOOST_INCLUDEDIR "/usr/include/boost"),修改set(Boost_LIBRARY_DIRS "${Boost_LIBRARY_DIRS}")为set(Boost_LIBRARY_DIRS "${/usr/lib/aarch64-linux-gnu/}"),并在find_package(Boost 1.58.0 ....)上面添加调试set(Boost_DEBUG ON),知道可能缺少哪些内容,然后自己进入/aarch64-linux-gnu/查看具体缺少什么文件,再apt-get安装即可。
参考:/xiangxianghehe/article/details/79028186
/kingmicrosoft/article/details/39377715
Could not findVTKConfig.cmakeor vtk-config.cmake
解决办法: (可尝试修改PCLConfig.cmake部分)或者编译的时候指定路径 cmake -DVTK_DIR=/path/to/vtk/build-directory ..
参考:/questions/28467230/cmake-could-not-find-the-vtkconfig-cmake
CMake Error at /usr/share/cmake/Modules/FindCUDA.cmake:488 (message):Specify CUDA_TOOLKIT_ROOT_DIR
解决办法: cmake -D CUDA_TOOLKIT_ROOT_DIR=CUDA_PATH ..
参考:/questions/19980412/how-to-let-cmake-find-cuda
若出现fatal error:Eigen/Dense: No such file or directory,可建立软链接,参考:/weixin_41102844/article/details/82708843
若cmake和make都通过,运行程序时出现segmention fault, 网上的解决办法是针对用从c++11编译,将程序该为release模式,即CMAKE_BUILD_TYPE设置为release,参考/u014610460/article/details/85223960。自己的解决办法是不新建build文件夹再cmake和make,直接在外面跑。