undefined reference to nlopt
I use sudo apt-get install libnlopt-dev
to install nlopt lib. when i catkin_make
in my pc, report says like bellow, like can't link the lib. i donot know how to fix the problem.
this is the report.
alex@ubuntu:~/planner_examples_ws$ catkin_make
Base path: /home/alex/planner_examples_ws
Source space: /home/alex/planner_examples_ws/src
Build space: /home/alex/planner_examples_ws/build
Devel space: /home/alex/planner_examples_ws/devel
Install space: /home/alex/planner_examples_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/alex/planner_examples_ws/build"
####
####
#### Running command: "make -j4 -l4" in "/home/alex/planner_examples_ws/build"
####
[ 0%] [ 0%] Built target geometry_msgs_generate_messages_cpp
Built target std_msgs_generate_messages_cpp
[ 0%] Built target std_msgs_generate_messages_lisp
[ 0%] Built target geometry_msgs_generate_messages_lisp
[ 0%] [ 0%] Built target _gridmapping_msgs_generate_messages_check_deps_GridObstacleUpdate
Built target _gridmapping_msgs_generate_messages_check_deps_GridPoint
[ 0%] Built target std_msgs_generate_messages_py
[ 0%] Built target geometry_msgs_generate_messages_py
[ 1%] Built target circular_curve_lib
[ 4%] Built target alglib
[ 4%] Built target gdal_utils
[ 6%] Built target math_utils
[ 6%] Built target boostrand1
[ 6%] Built target random_points1
[ 7%] Built target stupidrand1
[ 7%] Built target rosparam_util_getvector
[ 7%] Built target std_msgs_util
[ 12%] Built target sbpl
[ 12%] Built target nav_msgs_generate_messages_lisp
[ 12%] Built target _tictoc_profiler_generate_messages_check_deps_ProfilerEntry
[ 12%] Built target _ca_nav_msgs_generate_messages_check_deps_PathXYZVPsi
[ 12%] Built target _ca_nav_msgs_generate_messages_check_deps_PathXYZ
[ 12%] Built target _ca_nav_msgs_generate_messages_check_deps_XYZVPsi
[ 12%] Built target _ca_nav_msgs_generate_messages_check_deps_XYZVViewPoint
[ 39%] Built target ompl
[ 39%] Built target _ca_nav_msgs_generate_messages_check_deps_PathXYZVViewPoint
[ 39%] Built target nav_msgs_generate_messages_cpp
[ 39%] Built target nav_msgs_generate_messages_py
[ 39%] Built target _ca_nav_msgs_generate_messages_check_deps_LookAheadTime
[ 44%] Built target mesh_loader_3ds
[ 44%] Built target _ca_nav_msgs_generate_messages_check_deps_WorkspaceTrajectory
[ 44%] Built target pcl_util_examples
[ 45%] Built target pcl_util_pc2_iterator_examples
[ 45%] Built target pcl_util_rgb
[ 45%] Built target scrollgrid_examples
[ 45%] Built target tf_utils
[ 45%] Built target _shapes_generate_messages_check_deps_PolygonDepth
[ 45%] Built target _shapes_generate_messages_check_deps_Point2D
[ 45%] Built target _speed_profile_generate_messages_check_deps_SpeedProfile
[ 45%] Built target _shapes_generate_messages_check_deps_PolygonWithHolesDepth
[ 45%] Built target gridmapping_msgs_generate_messages_cpp
[ 46%] Built target gridmapping_msgs_generate_messages_lisp
[ 47%] Built target gridmapping_msgs_generate_messages_py
[ 48%] Built target alglib_minqp_d_bc1
[ 48%] [ 48%] Built target alglib_example_df
Built target circular_curve_lib_example_dubins_path_set
[ 51%] [ 51%] Built target gdal_utils_example_dem
Built target circular_curve_lib_example_trochoid
[ 51%] Built target ompl_GeometricCarPlanning
[ 51%] Built target math_utils_scratch
[ 52%] Built target ompl_HybridSystemPlanning
[ 52%] [ 52%] Built target ompl_HypercubeBenchmark
Built target ompl_KinematicChainBenchmark
[ 52%] Built target ompl_OptimalPlanning
[ 53%] Built target ompl_PlannerData
[ 53%] [ 53%] Built target ompl_PlannerProgressProperties
[ 53%] Built target ompl_RigidBodyPlanning
Built target ompl_Point2DPlanning
[ 54%] [ 54%] Built target ompl_RigidBodyPlanningWithControls
[ 54%] Built target ompl_RigidBodyPlanningWithIK
Built target ompl_RigidBodyPlanningWithIntegrationAndControls
[ 54%] Built target ompl_RigidBodyPlanningWithODESolverAndControls
[ 55%] [ 55%] [ 55%] Built target ompl_StateSampling
Built target test_adjacency_list
Built target ompl_state_example
[ 55%] Built target test_sbpl
[ 55%] Built target tictoc_profiler_generate_messages_cpp
[ 55%] [ 55%] [ 56%] Built target tictoc_profiler_generate_messages_py
Built target std_msgs_util_load_pose
Built target tictoc_profiler_generate_messages_lisp
[ 58%] [ 60%] Built target ca_nav_msgs_generate_messages_lisp
Built target ca_nav_msgs_generate_messages_cpp
[ 62%] Built target ca_nav_msgs_generate_messages_py
[ 63%] Built target mesh_loader_3ds_example
[ 64%] Built target shapes_generate_messages_cpp
[ 65%] Built target shapes_generate_messages_py
[ 66%] Built target shapes_generate_messages_lisp
[ 67%] Built target tf_utils_transform_vector
[ 67%] Built target speed_profile_generate_messages_cpp
[ 67%] [ 68%] Built target speed_profile_generate_messages_lisp
Built target speed_profile_generate_messages_py
[ 68%] Built target gridmapping_msgs_generate_messages
[ 68%] Built target tictoc_profiler
[ 68%] [ 68%] Built target tictoc_profiler_generate_messages
Built target ca_nav_msgs_generate_messages
[ 68%] Built target shapes_generate_messages
[ 68%] [ 68%] Built target speed_profile_generate_messages
Built target tictoc_profiler_example
[ 68%] Built target ca_nav_msgs_trajectory_converter
[ 68%] Built target ca_nav_msgs_trajectory_converter_example
[ 68%] Built target distancemap2
[ 72%] Built target shapes
[ 73%] Built target distancemap2_3d_obst_test
[ 73%] Built target shapes_cgal_complement
[ 73%] Built target distancemap2_subscribe_to_grid
[ 73%] Built target shapes_bbox_shape_example
[ 74%] Built target shapes_cgal_connect_holes
[ 74%] Built target shapes_cgal_difference
[ 74%] Built target shapes_cgal_multiple_holes
[ 74%] Built target shapes_cgal_nested_triangulation
[ 74%] [ 75%] Built target shapes_cgal_polygon_join_intersect
Built target shapes_cgal_polygon_intersection
[ 75%] Built ...
Please use the Preformatted Text button (the one with
101010
on it) next time when copying console text into your question. It makes things much easier to read. Thanks.ok, i'm sorry, first time to make a question.
This is most likely an issue with your CMakeLists.txt. Please update question and add that file. I haven't used nlopt much, but I was able to compile an example I had lying around with CMake by specifically appending path to SO file like the following: