File "PCLConfig.cmake" will unexpectedly change BOOST_ROOT and lead to link error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pcl (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
In PCLConfig.cmake line 115&116 says:
if(PCL_
set(BOOST_ROOT "${PCL_
,in which PCL_ALL_
cmake_minimum_
project(main)
find_package(
Boost
COMPONENTS
system
thread
chrono
REQUIRED
)
find_package(
PCL
REQUIRED
)
include_
${Boost_
)
link_directories(
${Boost_
)
add_executable(main main.cpp)
target_
main
${Boost_LIBRARIES}
)
Any used boost functions in main.cpp will lead to link error like this: main.cpp:5: undefined reference to `boost:
I assume you are using libpcl-dev_1.10.0 (Ubuntu 20.04) or libpcl-dev_1.11.1 (Ubuntu 20.10 and 21.04) based on that line 435 should set PCL_ALL_ IN_ONE_ INSTALLER to ON. That would be this line in git: https:/ /github. com/PointCloudL ibrary/ pcl/blob/ pcl-1.11. 1/PCLConfig. cmake.in# L411
PCL_ROOT is set to /usr in the package, so there would need to be a /usr/3rdParty folder on your system to trigger this behavior. That is not a path provided by Ubuntu and I would propose to remove it from your system and see if it fixes your problem.
I've send a PR upstream to fix this: https:/ /github. com/PointCloudL ibrary/ pcl/pull/ 4821