我正在使用Ubuntu 12.04机器,我有以下问题:我正在尝试使用CMake编译和构建C++文件,但是当我在"cmake .."之后给出命令"make"时,我得到错误:
pcl_openni_grabber.cpp:2:29:致命错误:pcl/point_cloud.h:没有终止此类文件或目录编译.
现在我的CMakeLists.txt如下:
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(pcl-openni-grabber)
find_package(PCL 1.2 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable (pcl_openni_grabber pcl_openni_grabber.cpp)
target_link_libraries (pcl_openni_grabber ${PCL_LIBRARIES})
Run Code Online (Sandbox Code Playgroud)
环境变量PCL_INCLUDE_DIRS包含的位置:
/usr/include/pcl-1.5
Run Code Online (Sandbox Code Playgroud)
现在经过2个小时的工作来了解问题后,我在命令find_package()中找到了它.在实践中,当我运行"cmake .."时,它返回错误的pcl库(点云库)路径.确实这是"cmake .."的输出:
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for …Run Code Online (Sandbox Code Playgroud)