flexible-collision-library / fcl

Flexible Collision Library
https://flexible-collision-library.github.io/
Other
1.35k stars 414 forks source link

undefined reference to `fcl::CollisionRequest<double>::CollisionRequest #571

Open jasmeetkaur9 opened 2 years ago

jasmeetkaur9 commented 2 years ago

Hi, I am trying to use fcl for my project. I am using 0.6 and installing it using make install. My CMakeLists.txt is as follows

make_minimum_required(VERSION 2.8.12)
project(mav_trajectory_generation_ros)
find_package(catkin_simple REQUIRED COMPONENTS message_filters)
catkin_simple(ALL_DEPS_REQUIRED)
set(CMAKE_MACOSX_RPATH 0)
set(CMAKE_CXX_COMPILER "clang++")

# Link against system catkin yaml-cpp if installed.
find_package(PkgConfig)
find_package(fcl REQUIRED)
find_package(ompl)
if (fcl_FOUND)
  message("fcl found!")
  include_directories(${fcl_INCLUDE_DIRS})
endif (fcl_FOUND) 

find_package(message_filters)
find_package(yaml_cpp_catkin QUIET)
if(${yaml_cpp_catkin_FOUND})
    message(STATUS "Found yaml_cpp_catkin, using instead of system library.")
    set(YamlCpp_LIBRARIES ${yaml_cpp_catkin_LIBRARIES})
    set(YamlCpp_INCLUDE_DIRS ${yaml_cpp_catkin_INCLUDE_DIRS})
else()
    message(STATUS "No yaml_cpp_catkin, using yaml-cpp system library instead.")
    pkg_check_modules(YamlCpp REQUIRED yaml-cpp>=0.5)
endif()

#############
# LIBRARIES #
#############

cs_add_library(${PROJECT_NAME}
  src/feasibility_analytic.cpp
  src/feasibility_base.cpp
  src/feasibility_recursive.cpp
  src/feasibility_sampling.cpp
  src/input_constraints.cpp
  src/ros_conversions.cpp
  src/ros_visualization.cpp
  src/minimal_path_planning.cpp
  src/path_planning2.cpp
)

############
# BINARIES #
############
cs_add_executable(trajectory_sampler_node
  src/trajectory_sampler_node.cpp
)
target_link_libraries(trajectory_sampler_node ${PROJECT_NAME} fcl ${OMPL_LIBRARIES} ) 

cs_add_executable(time_evaluation_node
  src/time_evaluation_node.cpp
)
target_link_libraries(time_evaluation_node ${PROJECT_NAME} fcl ${OMPL_LIBRARIES} )
#########
# TESTS #
#########
catkin_add_gtest(test_feasibility
  test/test_feasibility.cpp
)
target_link_libraries(test_feasibility ${PROJECT_NAME} ${catkin_LIBRARIES} fcl ${OMPL_LIBRARIES} ) 

##########
# EXPORT #
##########
cs_install()
cs_export()

And I get the error on doing a catkin build

undefined reference to `fcl::CollisionRequest<double>::CollisionRequest(unsigned long, bool, unsigned long, bool, bool, fcl::GJKSolverType, double)'
undefined reference to `fcl::CollisionObject<double>::~CollisionObject()'
undefined reference to `fcl::CollisionObject<double>::CollisionObject(std::shared_ptr<fcl::CollisionGeometry<double> > const&)'
undefined reference to `fcl::CollisionResult<double>::isCollision() const'
undefined reference to `unsigned long fcl::collide<double>(fcl::CollisionObject<double> const*, fcl::CollisionObject<double> const*, fcl::CollisionRequest<double> const&, fcl::CollisionResult<double>&)'
undefined reference to `fcl::CollisionObject<double>::setTransform(Eigen::Quaternion<double, 0> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)'
undefined reference to `fcl::CollisionResult<double>::CollisionResult()'
undefined reference to `fcl::Box<double>::Box(double, double, double)'
undefined reference to `fcl::OcTree<double>::OcTree(std::shared_ptr<octomap::OcTree const> const&)'

Please help.

LuckyBarbara commented 1 year ago

hello, do you solve this problem? I have the similar problem with you