PCL( I currently use CDT with cmake to build a Point Cloud Library (PCL) project.)

本文介绍了一个使用CMake构建PCL项目的案例,在Eclipse中遇到的编译无误但代码提示出现红色下划线的问题,并给出了通过调整包含路径解决PCL与Eigen库冲突的方法。
- PCL + cmake : Compiles Fine, but errors while in the path [SOLVED] [message #755517]Tue, 08 November 2011 16:59 Go to next message
boulch Mising nameFriend
Messages: 2
Registered: November 2011
Junior Member
 
Hello,

I currently use CDT with cmake to build a Point Cloud Library (PCL) project.

Here is my CMakeLists :
**********************************************************************
**********************************************************************
cmake_minimum_required(VERSION 2.Cool
PROJECT( project_name )

set(EXECUTABLE_NAME executable)
add_executable(
#executable
${EXECUTABLE_NAME}
#libraries
IOCloud.h
Ply.hpp
#source code
main.cpp
Ply.cpp

)

set(CMAKE_BUILD_TYPE Release)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
include_directories( ${CMAKE_CURRENT_BINARY_DIR})

#packages
#PointCloud Library
find_package( PCL 1.1 REQUIRED)
if(PCL_FOUND)
include_directories( ${PCL_INCLUDE_DIRS} )
link_directories( ${PCL_LIBRARY_DIRS} )
add_definitions( ${PCL_DEFINITIONS} )
target_link_libraries(
${EXECUTABLE_NAME}
${PCL_COMMON_LIBRARIES}
${PCL_IO_LIBRARIES}
${PCL_LIBRARIES}
)
endif()


#OpenMp
find_package( OpenMP REQUIRED)
#include(FindOpenMP)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
**********************************************************************
**********************************************************************
I'm running Eclipse 3.7.1 on Ubuntu 11.10
The project imported in Eclipse, compiles and runs fine.
The PCL libraries are in the include Path.
The completion works for #include <pcl/...
But all the pcl objects and function can't be resolved (red underline and "could not be resolved" message).
It looks like it doesn't know the namespace.

Can anyone help me ?

Thanks.

[Updated on: Mon, 29 July 2013 08:52]

Report message to a moderator

- Re: PCL + cmake : Compiles Fine, but errors while in the path [message #1075330 is a reply to message #755517]Mon, 29 July 2013 08:51 Go to previous message
boulch Mising nameFriend
Messages: 2
Registered: November 2011
Junior Member
 
It appears that PCL include conflicts with Eigen include.
In project-> properties -> include paths, removing the include of eigen solved the problem.

PS: this was for a project generated by CMake, for a imported makefile project, adding PCL to the dependency and Eigen produce the same problem.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值