Linking issues with catkin: undefined references

asked 2017-03-10 21:34:33 -0500

ruffsl gravatar image

I've been trying to use a sound source localization library I've attempted to catkinize, but am hitting some linking issues and am not sure why. I've followed the auto generated cmake files and adapted it to accommodate for the MARS libraries' use of in source directory header files, but I feel I'm still missing something. The packages and commits in question:

Here is the main error:

Starting >>> mars_ros                                                          
_______________________________________________________________________________
Errors << mars_ros:make /root/catkin_ws/logs/mars_ros/build.make.000.log       
CMakeFiles/buf_test.dir/src/buf_test.cpp.o: In function `main':
buf_test.cpp:(.text.startup+0xf): undefined reference to `arguments_construct_null()'
buf_test.cpp:(.text.startup+0x1b): undefined reference to `parameters_construct_null()'
buf_test.cpp:(.text.startup+0x23): undefined reference to `configs_construct_null()'
buf_test.cpp:(.text.startup+0x2b): undefined reference to `objects_construct_null()'
buf_test.cpp:(.text.startup+0xd1): undefined reference to `file2parameters(parameters*, char const*)'
buf_test.cpp:(.text.startup+0x103): undefined reference to `parameters2configs(configs*, parameters const*)'
buf_test.cpp:(.text.startup+0x144): undefined reference to `configs2objects(objects*, configs const*, arguments const*)'
buf_test.cpp:(.text.startup+0x191): undefined reference to `objects2objects_process(objects*, profiler_obj*)'
buf_test.cpp:(.text.startup+0x1d7): undefined reference to `arguments_destroy(arguments*)'
buf_test.cpp:(.text.startup+0x1df): undefined reference to `parameters_destroy(parameters*)'
buf_test.cpp:(.text.startup+0x1e7): undefined reference to `configs_destroy(configs*)'
buf_test.cpp:(.text.startup+0x1ef): undefined reference to `objects_destroy(objects*)'
buf_test.cpp:(.text.startup+0x36b): undefined reference to `profiler_destroy(profiler_obj*)'
buf_test.cpp:(.text.startup+0x3b0): undefined reference to `tracks_printf(tracks_obj const*)'
collect2: error: ld returned 1 exit status
make[2]: *** [/root/catkin_ws/devel/.private/mars_ros/lib/mars_ros/buf_test] Error 1
make[1]: *** [CMakeFiles/buf_test.dir/all] Error 2
make: *** [all] Error 2
cd /root/catkin_ws/build/mars_ros; catkin build --get-env mars_ros | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -
...............................................................................
Failed << mars_ros:make                         [ Exited with code 2 ]         
Failed <<< mars_ros                             [ 1.6 seconds ]                
[build] Summary: 2 of 3 packages succeeded.                                    
[build] Ignored: None.                                                         
[build] Warnings: None.                                                        
[build] Abandoned: No packages were abandoned.                                 
[build] Failed: 1 packages failed.                                             
[build] Runtime: 5.6 seconds total.                                            
[build] Note: Workspace packages have changed, please re-source setup files to use them.
The command '/bin/sh -c catkin config       --extend /opt/ros/$ROS_DISTRO       --cmake-args         -DCMAKE_BUILD_TYPE=Release &&     catkin build' returned a non-zero code: 1
Makefile:13: recipe for target 'build' failed
make: *** [build] Error 1

Here is entire verbose catkin build log.
And here is a dockerfile to reproduce the build error:

FROM ros:kinetic

# install deps
RUN apt-get -qq update && \
    apt-get -qq install -y \
      build-essential \
      cmake \
      git \
      libasound2-dev \
      libconfig++-dev \
      libfftw3-dev \
      python-catkin-tools && \
    rm -rf /var/lib/apt/lists/*

# setup catkin workspace
ENV CATKIN_WS=/root/catkin_ws
RUN mkdir -p $CATKIN_WS/src
WORKDIR $CATKIN_WS/src

# clone source
RUN git clone https://github.com/ruffsl/mars.git && \
    cd mars && \
    git checkout feb5c4fff3f0c16d623ac603b32bda450984a366
RUN git clone https://github.com/ruffsl/mars_ros.git && \
    cd mars_ros && \
    git checkout e3ecd15c3daac49d1fb4c7c14607fc0d6bc6fe1e

# catkin build
WORKDIR $CATKIN_WS
ENV TERM xterm
ENV PYTHONIOENCODING UTF-8
RUN catkin config \
      --extend /opt/ros/$ROS_DISTRO \
      --cmake-args \
        -DCMAKE_BUILD_TYPE=Release && \
    catkin build --verbose

Also any recommendations for the CMakelists ... (more)

edit retag flag offensive close merge delete