HKUST-Aerial-Robotics / Fast-Planner

A Robust and Efficient Trajectory Planner for Quadrotors
GNU General Public License v3.0
2.4k stars 665 forks source link

Error during Compilation: cannot find -lpose_utils #18

Closed mzahana closed 4 years ago

mzahana commented 4 years ago

Hi. I am trying to compile this package using catkin build. Environment is Ubuntu 18 with ROS melodic. I am getting the following error. Could you please give some hints on how to solve this? Thanks

Errors     << so3_disturbance_generator:make /home/aaal/catkin_ws/logs/so3_disturbance_generator/build.make.000.log                                                                                                                   
/usr/bin/ld: cannot find -lpose_utils
collect2: error: ld returned 1 exit status
make[2]: *** [/home/aaal/catkin_ws/devel/lib/so3_disturbance_generator/so3_disturbance_generator] Error 1
make[1]: *** [CMakeFiles/so3_disturbance_generator.dir/all] Error 2
make: *** [all] Error 2
ZbyLGsc commented 4 years ago

You may try compiling the pose_utils packange in the Utils folder, before compiling this so3_disturbance_generator.

mzahana commented 4 years ago

I tried

catkin build pose_utils

and

cd path/to/pose_utils
mkdir build && cd build
cmake .. && make && sudo make install
cd ~/catkin_ws
catkin build

I am still getting the same error

Errors     << so3_disturbance_generator:make /home/aaal/catkin_ws/logs/so3_disturbance_generator/build.make.003.log
/usr/bin/ld: cannot find -lpose_utils
collect2: error: ld returned 1 exit status

EDIT Here is my catkin_ws configuration in case it helps in debugging the issue.

Profile:                     default
Extending:        [explicit] /opt/ros/melodic
Workspace:                   /home/aaal/catkin_ws
---------------------------------------------------------
Build Space:        [exists] /home/aaal/catkin_ws/build
Devel Space:        [exists] /home/aaal/catkin_ws/devel
Install Space:      [unused] /home/aaal/catkin_ws/install
Log Space:          [exists] /home/aaal/catkin_ws/logs
Source Space:       [exists] /home/aaal/catkin_ws/src
DESTDIR:            [unused] None
---------------------------------------------------------
Devel Space Layout:          merged
Install Space Layout:        None
---------------------------------------------------------
Additional CMake Args:       -DCMAKE_BUILD_TYPE=Release
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
---------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
ZbyLGsc commented 4 years ago

This could happen because we have not tested the package on melodic. Someone seems to have fixed this problem in the pull request, and you may refer to https://github.com/HKUST-Aerial-Robotics/Fast-Planner/pull/6/https://github.com/HKUST-Aerial-Robotics/Fast-Planner/pull/6/. Basically it change some linking targets related to pose_utils in CMakeLists

ZbyLGsc commented 4 years ago

@mzahana Another possible reason is that you use catkin build instead of catkin_make, which also has not been tested yet. The catkin build is a more updated tools that builds each package in a workspace’s source space in isolation in order to prevent build-time cross-talk. This may cause linking problem between the packages. I STRONGLY recommend you to create a new workspace and use catkin_make as stated in the readme.

patrickpoirier51 commented 4 years ago

Hello @mzahana :-)

It works OK with catkin build under Bionic and Melodic

The answers are in the PR https://github.com/HKUST-Aerial-Robotics/Fast-Planner/pulls

mzahana commented 4 years ago

@ZbyLGsc thanks for the suggestions, the pr you mentioned worked for me.

@patrickpoirier51 nice to meet you again :) and yes that PR compiled with me.